aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2021-07-08 16:43:20 +0200
committerDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2021-07-08 16:43:20 +0200
commitb975bb69043c8857bbfb5c152e6e277beadf5853 (patch)
tree0cbf98f1512f607bc94dd46a42328f6c51d6b3d8 /src
parent6bea345ecf8a6cc451b2a7434b8294acacfbe0b4 (diff)
downloadRWA.Support.DesktopApp-b975bb69043c8857bbfb5c152e6e277beadf5853.tar.gz
RWA.Support.DesktopApp-b975bb69043c8857bbfb5c152e6e277beadf5853.tar.bz2
RWA.Support.DesktopApp-b975bb69043c8857bbfb5c152e6e277beadf5853.zip
Don't crash on failure but show an error message.
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*>);