Don't crash if there are no lane result summary entries when rendering
[htsworkflow.git] / htsworkflow / frontend / samples / views.py
index 9ddc5775a395c2f5485f7872a46d81371723c698..d79d0b83976adc49dff287850e1a71a80796d4d0 100644 (file)
@@ -249,7 +249,10 @@ def _summary_stats(flowcell_id, lane_id):
                 eland_summary = ResultLane(lane_id=lane_id, end=end)
             # add information to lane_summary
             eland_summary.flowcell_id = flowcell_id
-            eland_summary.clusters = gerald_summary[end][lane_id].cluster
+            if len(gerald_summary) > end and gerald_summary[end].has_key(lane_id):
+                eland_summary.clusters = gerald_summary[end][lane_id].cluster
+            else:
+                eland_summary.clusters = 'n/a'
             eland_summary.cycle_width = cycle_width
             if hasattr(eland_summary, 'genome_map'):
                 eland_summary.summarized_reads = runfolder.summarize_mapped_reads(