Skip to content

Commit f4d0e94

Browse files
committed
fix: prevent non-strings from getting past media type check
1 parent 61844e4 commit f4d0e94

File tree

1 file changed

+2
-1
lines changed
  • src/aind_qc_portal/view_contents/panels/media

1 file changed

+2
-1
lines changed

src/aind_qc_portal/view_contents/panels/media/media.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def _init_panel_objects(self):
8686

8787
def _determine_media_type(self, reference: str):
8888
"""Determine the media type from the reference without loading the full media object"""
89-
if not reference:
89+
if not reference or not isinstance(reference, str):
90+
print(f"Could not determine media type for reference: {reference} of type {type(reference)}")
9091
self.media_type = "Unknown"
9192
return
9293

0 commit comments

Comments
 (0)