Check nullptr before calling the windows message hook for WM_ENTERSIZEMOVE and WM_ENTERMENULOOP

This commit is contained in:
WinterSquire 2025-02-04 12:46:17 +08:00 committed by Sam Lantinga
parent e7f326a84e
commit eb5ab22032
1 changed files with 4 additions and 2 deletions

View File

@ -1721,8 +1721,10 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
case WM_ENTERSIZEMOVE:
case WM_ENTERMENULOOP:
{
if (!DispatchModalLoopMessageHook(&hwnd, &msg, &wParam, &lParam)) {
return 0;
if (g_WindowsMessageHook) {
if (!DispatchModalLoopMessageHook(&hwnd, &msg, &wParam, &lParam)) {
return 0;
}
}
++data->in_modal_loop;