diff options
| author | moneromooo.monero <moneromooo.monero@users.noreply.github.com> | 2018-03-03 23:01:03 +0000 |
|---|---|---|
| committer | moneromooo.monero <moneromooo.monero@users.noreply.github.com> | 2018-03-03 23:27:15 +0000 |
| commit | f45b0a7d25920f445d83d14415791dda48b8185c (patch) | |
| tree | eed3f2644b13061135e4e019c4d28d4c9f8686f8 | |
| parent | 986275c42c60223b1fedcf8688d8026dbad7b792 (diff) | |
| download | monzero-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
| -rw-r--r-- | main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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"); |
