main: Fix nullptr access on Windows

The SharedTools::createApplication changes the last
Options::appArguments element value to 0.

Amends c811b93ece

Change-Id: Ie0d220ab45b25fee65f82410195095fd074cdf39
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2024-07-29 13:17:57 +02:00
parent 789872a0f9
commit 18f0e3d4d0

View File

@@ -700,7 +700,7 @@ int main(int argc, char **argv)
if (HostOsInfo::isWindowsHost()) { if (HostOsInfo::isWindowsHost()) {
const bool hasStyleOption = Utils::findOrDefault(options.appArguments, [](char *arg) { const bool hasStyleOption = Utils::findOrDefault(options.appArguments, [](char *arg) {
return strcmp(arg, "-style") == 0; return arg && strcmp(arg, "-style") == 0;
}); });
if (!hasStyleOption) { if (!hasStyleOption) {
// The Windows 11 default style (Qt 6.7) has major issues, therefore // The Windows 11 default style (Qt 6.7) has major issues, therefore