From a8a6f53e2da871ad8d461661210f1922fcd9b450 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 26 Jan 2019 13:01:44 +0100 Subject: [PATCH] Fix the configuration load process breaking in case of no plugins --- pyrogram/client/client.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index eb205bc2..32612821 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1087,14 +1087,15 @@ class Client(Methods, BaseClient): "exclude": section.get("exclude") or None } except KeyError: - pass + self.plugins = {} - for option in ["include", "exclude"]: - if self.plugins[option] is not None: - self.plugins[option] = [ - (i.split()[0], i.split()[1:] or None) - for i in self.plugins[option].strip().split("\n") - ] + if self.plugins: + for option in ["include", "exclude"]: + if self.plugins[option] is not None: + self.plugins[option] = [ + (i.split()[0], i.split()[1:] or None) + for i in self.plugins[option].strip().split("\n") + ] def load_session(self): try: