aboutsummaryrefslogtreecommitdiff
path: root/src/scenes
diff options
context:
space:
mode:
authorDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2021-07-12 12:48:28 +0200
committerDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2021-07-12 12:48:28 +0200
commit7b1fa0b22598305b8c50fda543131d2d14d1df63 (patch)
treeb3ba8167b0328283cbae12861253b33557a9ead2 /src/scenes
parentacf033cbb15641a79a093c301efa3fd478237c2a (diff)
downloadRWA.Support.DesktopApp-7b1fa0b22598305b8c50fda543131d2d14d1df63.tar.gz
RWA.Support.DesktopApp-7b1fa0b22598305b8c50fda543131d2d14d1df63.tar.bz2
RWA.Support.DesktopApp-7b1fa0b22598305b8c50fda543131d2d14d1df63.zip
Don't crash on startup if the session service isn't reachable.
Diffstat (limited to 'src/scenes')
-rw-r--r--src/scenes/add_server_wizard/add_server_wizard.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/scenes/add_server_wizard/add_server_wizard.cpp b/src/scenes/add_server_wizard/add_server_wizard.cpp
index e398b19..9b67ebc 100644
--- a/src/scenes/add_server_wizard/add_server_wizard.cpp
+++ b/src/scenes/add_server_wizard/add_server_wizard.cpp
@@ -67,6 +67,15 @@ void Add_Server_wizard::add_server(QString host_url, QString host_alias) {
}
void Add_Server_wizard::add_web_app_host_response(QJsonDocument *doc) {
+ // Q_ASSERT lets the program crash immediatly at startup,
+ // when the session service is not started.
+ // Don't use Q_ASSERT(doc != nullptr); instead use:
+ if (doc == nullptr) {
+ _main_gui->setRWAHostSelected(false);
+ _main_gui->showToast(tr("Can't connect to underlying session service!"), 9800);
+ return;
+ }
+
// Get the QJsonObject
QJsonObject jObject = doc->object();
QVariantMap mainMap = jObject.toVariantMap();