Skip to content

Commit

Permalink
Handle ValueError ("not enough image data") on Image.open gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
boramalper committed Jun 21, 2020
1 parent 768965a commit bdf1c3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nm_iconfinder/nm_iconfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def from_url(cls, url: str) -> Optional["Icon"]:
with BytesIO(res.content) as bio:
try:
img = Image.open(bio)
except UnidentifiedImageError:
except (UnidentifiedImageError, ValueError):
return None
width, height = img.size
# Ignore non-square Icons
Expand Down

0 comments on commit bdf1c3a

Please sign in to comment.