Skip to content

Commit 26bf84e

Browse files
committed
Don't try to parse ChatPhoto objects in case peer_access_hash is None
1 parent ff9407a commit 26bf84e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pyrogram/client/types/user_and_chats/chat_photo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ def _parse(client, chat_photo: types.UserProfilePhoto or types.ChatPhoto, peer_i
5555
if not isinstance(chat_photo, (types.UserProfilePhoto, types.ChatPhoto)):
5656
return None
5757

58+
if not peer_access_hash:
59+
return None
60+
5861
photo_id = getattr(chat_photo, "photo_id", 0)
5962
loc_small = chat_photo.photo_small
6063
loc_big = chat_photo.photo_big

0 commit comments

Comments
 (0)