From 2d4b424dbd818b3baf1551a37c0669ae910a4abf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 2 Feb 2022 08:35:47 +0530 Subject: [PATCH] Dont attempt to read NULL MSG.lParam --- src/calibre/gui2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 6f8a898f7c..9facf6188b 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -1621,7 +1621,7 @@ def nativeEventFilter(self, eventType, message): if eventType == b"windows_generic_MSG": msg = ctypes.wintypes.MSG.from_address(message.__int__()) # https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-settingchange - if msg.message == 0x001A: # WM_SETTINGCHANGE + if msg.message == 0x001A and msg.lParam: # WM_SETTINGCHANGE if ctypes.wstring_at(msg.lParam) == 'ImmersiveColorSet': QApplication.instance().check_for_windows_palette_change() # prevent Qt from handling this event