Apparently we might be receiving None, so this check should fix it.
authorBrandon King <kingb@caltech.edu>
Wed, 17 Jun 2009 18:39:42 +0000 (18:39 +0000)
committerBrandon King <kingb@caltech.edu>
Wed, 17 Jun 2009 18:39:42 +0000 (18:39 +0000)
htsworkflow/frontend/samples/views.py

index e64ce6748660c8034b4e8589399fed138a1a6d8b..9d355e29578afbf5fe0f26db41b6b9c91b00eba5 100644 (file)
@@ -322,15 +322,16 @@ def _make_eland_results(flowcell_id, lane, interesting_flowcells):
 
     # Loop throw storage devices if a result has been archived
     storage_id_list = []
-    for lts in cur_fc.longtermstorage_set.all():
-        for sd in lts.storage_devices.all():
-            # Use barcode_id if it exists
-            if sd.barcode_id is not None and sd.barcode_id != '':
-                storage_id_list.append(sd.barcode_id)
-            # Otherwise use UUID
-            else:
-                storage_id_list.append(sd.uuid)
-    
+    if cur_fc is not None:
+        for lts in cur_fc.longtermstorage_set.all():
+            for sd in lts.storage_devices.all():
+                # Use barcode_id if it exists
+                if sd.barcode_id is not None and sd.barcode_id != '':
+                    storage_id_list.append(sd.barcode_id)
+                # Otherwise use UUID
+                else:
+                    storage_id_list.append(sd.uuid)
+        
     # Formatting for template use
     if len(storage_id_list) == 0:
         storage_ids = None