diff --git a/windows/timer.c b/windows/timer.c index 030da6655fe..23209f29df7 100644 --- a/windows/timer.c +++ b/windows/timer.c @@ -104,7 +104,7 @@ static UINT TIMER_SetTimer( HWND hwnd, UINT id, UINT timeout, TIMER * pTimer; HWINDOWPROC winproc = 0; - if (GetWindowThreadProcessId( hwnd, NULL ) != GetCurrentThreadId()) + if (hwnd && GetWindowThreadProcessId( hwnd, NULL ) != GetCurrentThreadId()) { SetLastError( ERROR_INVALID_WINDOW_HANDLE ); return 0;