Fix is_connected accessing unexisting property

This commit is contained in:
Lonami Exo 2018-06-28 16:04:12 +02:00
parent 0f5f6cc050
commit ac6dbb8a5c

View File

@ -287,7 +287,8 @@ class TelegramBaseClient(abc.ABC):
"""
Returns ``True`` if the user has connected.
"""
return self._sender.is_connected()
sender = getattr(self, '_sender', None)
return sender and sender.is_connected()
async def disconnect(self):
"""