From 9c8ac8fb8b7e838ce59a94c423c740e072a27e1b Mon Sep 17 00:00:00 2001 From: lx-s Date: Thu, 25 Aug 2022 12:01:39 +0200 Subject: [PATCH] Fixed crash in WM_SETTINGSCHANGE when lParam is nullptr Fixes #16 --- WinMute/WinMute.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WinMute/WinMute.cpp b/WinMute/WinMute.cpp index 7f7e6b7..f2b08e1 100644 --- a/WinMute/WinMute.cpp +++ b/WinMute/WinMute.cpp @@ -620,7 +620,8 @@ LRESULT CALLBACK WinMute::WindowProc( } return 0; case WM_SETTINGCHANGE: { - if (wcscmp(reinterpret_cast(lParam), L"ImmersiveColorSet") == 0) { + const wchar_t *changeParam = reinterpret_cast(lParam); + if (changeParam != nullptr && wcscmp(changeParam, L"ImmersiveColorSet") == 0) { bool isDarkMode = true; IsDarkMode(isDarkMode); hTrayIcon_ = LoadIconW( -- 2.43.0