aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main_qmladaptor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main_qmladaptor.cpp b/src/main_qmladaptor.cpp
index c321ec8..845da0a 100644
--- a/src/main_qmladaptor.cpp
+++ b/src/main_qmladaptor.cpp
@@ -81,7 +81,13 @@ QList<QObject*> MainQMLAdaptor::getRWAHostModel() {
}
void MainQMLAdaptor::get_web_app_hosts_response(QJsonDocument *doc) {
- Q_ASSERT(doc != nullptr);
+ // Don't use Q_ASSERT(doc != nullptr); instead use:
+ if (doc == nullptr) {
+ showToast(tr("Can't connect to underlying session service!"), 10000);
+ return;
+ }
+ // Q_ASSERT lets the program crash immediatly at startup,
+ // when the session service is not started.
delete _rwaHostModel;
setRWAHostModel(new QList<QObject*>);