From 18f0e3d4d0498efbdf382338d4c648c4cbc71719 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 29 Jul 2024 13:17:57 +0200 Subject: [PATCH] main: Fix nullptr access on Windows The SharedTools::createApplication changes the last Options::appArguments element value to 0. Amends c811b93ece285ef6584144a404555218391e165b Change-Id: Ie0d220ab45b25fee65f82410195095fd074cdf39 Reviewed-by: hjk --- src/app/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 629e3ed98ae..3bacb6850e0 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -700,7 +700,7 @@ int main(int argc, char **argv) if (HostOsInfo::isWindowsHost()) { const bool hasStyleOption = Utils::findOrDefault(options.appArguments, [](char *arg) { - return strcmp(arg, "-style") == 0; + return arg && strcmp(arg, "-style") == 0; }); if (!hasStyleOption) { // The Windows 11 default style (Qt 6.7) has major issues, therefore