Skip to content

Commit 7b79edb

Browse files
committed
added type guard
1 parent 7524370 commit 7b79edb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wids/wids_decode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ def default_decoder(
168168
decode_all_gz(result, update_key=gz_update_key) # for backwards compatibility
169169
decode_basic(result)
170170

171-
if format.lower() == "pil":
171+
if isinstance(format, str) and format.lower() == "pil":
172172
decode_images_to_pil(result)
173-
elif format.lower() == "numpy":
173+
elif isinstance(format, str) and format.lower() == "numpy":
174174
decode_images_to_numpy(result)
175175
else:
176176
raise ValueError(f"Unknown format: {format}")

0 commit comments

Comments
 (0)