Skip to content

Commit a527bf7

Browse files
committed
Fixed: AttributeError: 'NoneType' object has no attribute 'channel_id'
1 parent 44562c8 commit a527bf7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • pyrogram/types/user_and_chats

pyrogram/types/user_and_chats/chat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,11 @@ async def _parse_full(client, chat_full: Union[raw.types.messages.ChatFull, raw.
325325

326326
if isinstance(default_send_as, raw.types.PeerUser):
327327
send_as_raw = users[default_send_as.user_id]
328-
else:
328+
parsed_chat.send_as_chat = Chat._parse_chat(client, send_as_raw)
329+
elif default_send_as:
329330
send_as_raw = chats[default_send_as.channel_id]
331+
parsed_chat.send_as_chat = Chat._parse_chat(client, send_as_raw)
330332

331-
parsed_chat.send_as_chat = Chat._parse_chat(client, send_as_raw)
332333

333334
if full_chat.pinned_msg_id:
334335
parsed_chat.pinned_message = await client.get_messages(

0 commit comments

Comments
 (0)