Skip to content

Commit c7d60ef

Browse files
committed
Fix disconnect handler callback being called on every session
1 parent fa7b7d0 commit c7d60ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyrogram/session/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def stop(self):
197197
for i in self.results.values():
198198
i.event.set()
199199

200-
if self.client and callable(self.client.disconnect_handler):
200+
if not self.is_media and callable(self.client.disconnect_handler):
201201
try:
202202
self.client.disconnect_handler(self.client)
203203
except Exception as e:

0 commit comments

Comments
 (0)