diff --git a/reactos/subsystems/win32/win32k/ntuser/painting.c b/reactos/subsystems/win32/win32k/ntuser/painting.c index ebc4da2f22a..cb48e73dbb9 100644 --- a/reactos/subsystems/win32/win32k/ntuser/painting.c +++ b/reactos/subsystems/win32/win32k/ntuser/painting.c @@ -1821,7 +1821,7 @@ BOOL UserDrawCaption( ButtonWidth = UserGetSystemMetrics(SM_CXSMSIZE) - 2; else ButtonWidth = UserGetSystemMetrics(SM_CXSIZE) - 2; - if(pWnd->Style & WS_SYSMENU) + if ((pWnd != NULL) && (pWnd->Style & WS_SYSMENU)) { r.right -= 3 + ButtonWidth; if(! (uFlags & DC_SMALLCAP))