Check if there's an active connection before updating notification rules

This commit is contained in:
Joshua Goins
2023-08-19 17:19:05 -04:00
parent c71672dab3
commit ba116460d5

View File

@@ -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)