From ba116460d5f9cd81c66e842f28fcc4cdbe38ea4e Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 19 Aug 2023 17:19:05 -0400 Subject: [PATCH] Check if there's an active connection before updating notification rules --- src/models/pushrulemodel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/models/pushrulemodel.cpp b/src/models/pushrulemodel.cpp index e5afe6988..fd85a7cbb 100644 --- a/src/models/pushrulemodel.cpp +++ b/src/models/pushrulemodel.cpp @@ -69,8 +69,10 @@ PushRuleModel::PushRuleModel(QObject *parent) void PushRuleModel::controllerConnectionChanged() { - connect(Controller::instance().activeConnection(), &Quotient::Connection::accountDataChanged, this, &PushRuleModel::updateNotificationRules); - updateNotificationRules("m.push_rules"); + if (Controller::instance().activeConnection()) { + connect(Controller::instance().activeConnection(), &Quotient::Connection::accountDataChanged, this, &PushRuleModel::updateNotificationRules); + updateNotificationRules("m.push_rules"); + } } void PushRuleModel::updateNotificationRules(const QString &type)