diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-08-24 16:41:42 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-29 15:33:26 +0000 |
commit | 5867c3e1bba41fff3fcc55444108ac794634cb6f (patch) | |
tree | c12b6f813f09fab1ad8950fe83564e24789d42b1 /tools | |
parent | 29baa90d2d5a5632a111cbcde852671cd4114f39 (diff) |
qmlimportscanner: Don't crash on invalid argument
Apparently you can pass one "root path" as a bare argument, but you have
to specify "-rootPath" if you want to pass more than one. The whole
concept of a "root path" is wrong. Therefore let's not add more ways to
specify root paths. It should not crash, though.
Fixes: QTBUG-104928
Change-Id: Ie8a10ac7208f927fdb1fed0f87c088739b41c983
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d937a53cbcd72304ba1c613ed2d2dc2010542f7e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlimportscanner/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/qmlimportscanner/main.cpp b/tools/qmlimportscanner/main.cpp index 820a3987c2..1b2dbf285c 100644 --- a/tools/qmlimportscanner/main.cpp +++ b/tools/qmlimportscanner/main.cpp @@ -940,8 +940,12 @@ int main(int argc, char *argv[]) std::cerr << qPrintable(appName) << ": No such file or directory: \"" << qPrintable(arg) << "\"\n"; return 1; - } else { + } else if (argReceiver) { *argReceiver += arg; + } else { + std::cerr << qPrintable(appName) << ": Invalid argument: \"" + << qPrintable(arg) << "\"\n"; + return 1; } } } |