Skip to content

Commit

Permalink
Handle null IReference
Browse files Browse the repository at this point in the history
  • Loading branch information
ynkdir committed Jan 5, 2025
1 parent e5e10f1 commit 2b62ffd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions win32more/_winrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def winrt_easycast(obj, type_):
return Vector[get_args(type_)[0]](obj)
elif issubclass(_get_origin_or_itself(type_), IReference):
# FIXME: Should I check obj is T of IReference[T]?
if obj is None:
return IReference(None)
return box_value(obj).as_(type_)
return easycast(obj, type_)

Expand Down

0 comments on commit 2b62ffd

Please sign in to comment.