Skip to content

Commit

Permalink
Only call from_res if src has width, height
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Oct 10, 2024
1 parent 05f73eb commit a69ab89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vstools/enums/stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ def _base_from_video(
if isinstance(src, vs.FrameProps):
raise exception('Can\'t determine {class_name} from FrameProps.', func, class_name=cls)

return cls.from_res(src)
if all(hasattr(src, x) for x in ('width', 'height')):
return cls.from_res(src)

return cls(value)

Expand Down

0 comments on commit a69ab89

Please sign in to comment.