]> repos.lx-s.de Git - winmute.git/commitdiff
Fixed crash in WM_SETTINGSCHANGE when lParam is nullptr Fixes #16
authorlx-s <lx-s@users.noreply.github.com>
Thu, 25 Aug 2022 10:01:39 +0000 (12:01 +0200)
committerlx-s <lx-s@users.noreply.github.com>
Thu, 25 Aug 2022 10:01:44 +0000 (12:01 +0200)
WinMute/WinMute.cpp

index 7f7e6b7648cc11ffb199a4ccf2198d5c04717cb0..f2b08e11f33a1d1b961af2cf2761d729432feab2 100644 (file)
@@ -620,7 +620,8 @@ LRESULT CALLBACK WinMute::WindowProc(
       }
       return 0;
    case WM_SETTINGCHANGE: {
-      if (wcscmp(reinterpret_cast<const wchar_t*>(lParam), L"ImmersiveColorSet") == 0) {
+      const wchar_t *changeParam = reinterpret_cast<const wchar_t *>(lParam);
+      if (changeParam != nullptr && wcscmp(changeParam, L"ImmersiveColorSet") == 0) {
          bool isDarkMode = true;
          IsDarkMode(isDarkMode);
          hTrayIcon_ = LoadIconW(