From 42b4e57f5563c15eee39a242c98306cedcd7bc03 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 10 Jul 2013 17:48:06 +0200 Subject: [PATCH] QmlDesigner.Qml2Puppet: crash fix If if have less then one argument show some help end exit. The code afterwards assumes that we have at least one argument. Change-Id: I555e02dc03c2319eef713b880cf43d740d64e942 Reviewed-by: Marco Bubke --- .../qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp index e772ac3226..d16c9415b0 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppetmain.cpp @@ -61,6 +61,13 @@ int main(int argc, char *argv[]) QCoreApplication::setApplicationName("Qml2Puppet"); QCoreApplication::setApplicationVersion("1.0.0"); + if (application.arguments().count() < 2) { + qDebug() << "Usage:\n"; + qDebug() << "--test"; + qDebug() << "--version"; + return -1; + } + if (application.arguments().count() == 2 && application.arguments().at(1) == "--test") { qDebug() << QCoreApplication::applicationVersion(); QQmlEngine engine; -- GitLab