Function generating index text was assuming there'd always be an index
[htsworkflow.git] / htsworkflow / frontend / samples / models.py
index b81b122111332c1b695541cfba3cef058f822a61..2eeaaecbe3b3aa9d3fc4c651e9774c70b6e4e383 100644 (file)
@@ -258,6 +258,9 @@ class Library(models.Model):
   def index_sequence_text(self, seperator=' '):
       """Return formatted multiplex index sequences"""
       sequences = self.index_sequences()
+      if sequences is None:
+          return ""
+
       multiplex_ids = sequences.keys()
       multiplex_ids.sort()
       return seperator.join(( "%s:%s" %(i,sequences[i]) for i in multiplex_ids))