mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Don't try to parse ChatPhoto objects in case peer_access_hash is None
This commit is contained in:
parent
ff9407aba1
commit
26bf84e43d
@ -55,6 +55,9 @@ class ChatPhoto(Object):
|
|||||||
if not isinstance(chat_photo, (types.UserProfilePhoto, types.ChatPhoto)):
|
if not isinstance(chat_photo, (types.UserProfilePhoto, types.ChatPhoto)):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
if not peer_access_hash:
|
||||||
|
return None
|
||||||
|
|
||||||
photo_id = getattr(chat_photo, "photo_id", 0)
|
photo_id = getattr(chat_photo, "photo_id", 0)
|
||||||
loc_small = chat_photo.photo_small
|
loc_small = chat_photo.photo_small
|
||||||
loc_big = chat_photo.photo_big
|
loc_big = chat_photo.photo_big
|
||||||
|
Loading…
x
Reference in New Issue
Block a user