Skip to content

Commit

Permalink
skip NoneType error as we had in early 2025
Browse files Browse the repository at this point in the history
  • Loading branch information
adRn-s committed Jan 21, 2025
1 parent fead495 commit a9e98f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/flowcell/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def get_protocol(self, obj):
records = obj.pool.libraries.all() or obj.pool.samples.all()

for record in records:
protocols.append(record.library_protocol.name)
if record.library_protocol:
protocols.append(record.library_protocol.name)
else:
protocols.append(None)

if len(protocols) == 1 or len(set(protocols)) == 1:
return protocols[0]
Expand Down

0 comments on commit a9e98f0

Please sign in to comment.