forked from qt-creator/qt-creator
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 <marco.bubke@digia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user