mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-23 13:36:39 +00:00
Raise ConnectionError when sending without connection
Otherwise the program could potentially block on await client(...) since this has no timeout (unless asyncio.wait_for() was used) and would give no further hint that the program was halted there.
This commit is contained in:
parent
d5b349e031
commit
e36aff51dd
@ -188,6 +188,9 @@ class MTProtoSender:
|
|||||||
Since the receiving part is "built in" the future, it's
|
Since the receiving part is "built in" the future, it's
|
||||||
impossible to await receive a result that was never sent.
|
impossible to await receive a result that was never sent.
|
||||||
"""
|
"""
|
||||||
|
if not self._user_connected:
|
||||||
|
raise ConnectionError('Cannot send requests while disconnected')
|
||||||
|
|
||||||
if utils.is_list_like(request):
|
if utils.is_list_like(request):
|
||||||
result = []
|
result = []
|
||||||
after = None
|
after = None
|
||||||
|
Loading…
Reference in New Issue
Block a user