Fix crash when opening notification settings with no account by making sure that the keyword model doesn't try to update the noficiation settings when there is no active connection.

Also make sure that ability to add a keyword or change the global notiifcaiton state is disabled without an active connection as these will cause the same crash.
This commit is contained in:
James Graham
2022-12-11 11:53:21 +00:00
committed by Tobias Fella
parent 9334585e0f
commit 6b3f44e923
2 changed files with 6 additions and 2 deletions

View File

@@ -15,7 +15,9 @@
KeywordNotificationRuleModel::KeywordNotificationRuleModel(QObject *parent)
: QAbstractListModel(parent)
{
controllerConnectionChanged();
if (Controller::instance().activeConnection()) {
controllerConnectionChanged();
}
connect(&Controller::instance(), &Controller::activeConnectionChanged, this, &KeywordNotificationRuleModel::controllerConnectionChanged);
}