aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
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");