From fcf0e4515f9ac99d7b8168890ba946e08740153b Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 3 Apr 2018 14:54:34 +0200 Subject: [PATCH] Don't try to stop a non-started Client --- pyrogram/client/client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 08e0e117..be04db75 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -245,6 +245,9 @@ class Client: """Use this method to manually stop the Client. Requires no parameters. """ + if not self.is_started: + raise ConnectionError("Client is already stopped") + self.is_started = False self.session.stop()