aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authormoneromooo.monero <moneromooo.monero@users.noreply.github.com>2018-03-03 23:01:03 +0000
committermoneromooo.monero <moneromooo.monero@users.noreply.github.com>2018-03-03 23:27:15 +0000
commitf45b0a7d25920f445d83d14415791dda48b8185c (patch)
treeeed3f2644b13061135e4e019c4d28d4c9f8686f8 /main.cpp
parent986275c42c60223b1fedcf8688d8026dbad7b792 (diff)
downloadmonzero-gui-f45b0a7d25920f445d83d14415791dda48b8185c.tar.gz
monzero-gui-f45b0a7d25920f445d83d14415791dda48b8185c.tar.xz
monzero-gui-f45b0a7d25920f445d83d14415791dda48b8185c.zip
main: do not crash if we can't load some stuff
This happens with some Qt widgets/components aren't found
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 08bcb9e3..fba82fec 100644
--- a/main.cpp
+++ b/main.cpp
@@ -255,7 +255,17 @@ int main(int argc, char *argv[])
// Load main window (context properties needs to be defined obove this line)
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
+ if (engine.rootObjects().isEmpty())
+ {
+ qCritical() << "Error: no root objects";
+ return 1;
+ }
QObject *rootObject = engine.rootObjects().first();
+ if (!rootObject)
+ {
+ qCritical() << "Error: no root objects";
+ return 1;
+ }
#ifdef WITH_SCANNER
QObject *qmlCamera = rootObject->findChild<QObject*>("qrCameraQML");