From a3206501de2d1f75f20d397ca0fd2e3d37057d1a Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 2 Mar 2021 08:07:50 -0400 Subject: [PATCH] Fix mypy complaint in MatrixClient.edit_pushrule --- src/backend/matrix_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index 5a5f36fc..1e130c4a 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -1858,7 +1858,7 @@ class MatrixClient(nio.AsyncClient): if enable is not None and (old.enabled if old else True) != enable: await self.enable_pushrule("global", kind, rule_id, enable) - elif kind_change or rule_id_change and not old.enabled: + elif kind_change or rule_id_change and old and not old.enabled: await self.enable_pushrule("global", kind, rule_id, False)