From d0c566bbdb923898b91a1f629384fc8511a45540 Mon Sep 17 00:00:00 2001 From: Nikolay Tretyak Date: Sat, 4 Aug 2018 12:30:24 +0300 Subject: [PATCH] Fix iter_participants is failing when _total is None (#936) --- telethon/client/chats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telethon/client/chats.py b/telethon/client/chats.py index 5a5550f0..3680f7c2 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -137,7 +137,8 @@ class ChatMethods(UserMethods): if not isinstance( full.full_chat.participants, types.ChatParticipants): # ChatParticipantsForbidden won't have ``.participants`` - _total[0] = 0 + if _total: + _total[0] = 0 return if _total: