From 01438f28f624bbec090c923943d255a09a789eb6 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 21 Jun 2019 11:14:10 +0100 Subject: [PATCH] check we have a mode before trying to remove it --- src/IRCServer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/IRCServer.py b/src/IRCServer.py index 0316cc60..a1887fb7 100644 --- a/src/IRCServer.py +++ b/src/IRCServer.py @@ -158,7 +158,8 @@ class Server(IRCObject.Object): def add_own_mode(self, mode: str, arg: str=None): self.own_modes[mode] = arg def remove_own_mode(self, mode: str): - del self.own_modes[mode] + if mode in self.own_modes: + del self.own_modes[mode] def change_own_mode(self, remove: bool, mode: str, arg: str=None): if remove: self.remove_own_mode(mode)