From a8ab2ae5628a54444a5fd4e20bc3cd3b1c7a5a24 Mon Sep 17 00:00:00 2001 From: dcnieho Date: Fri, 20 Jul 2012 06:48:05 +0000 Subject: [PATCH] need to check for NULL as well.... git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1349 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/mswin/fg_main_mswin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/src/mswin/fg_main_mswin.c b/freeglut/freeglut/src/mswin/fg_main_mswin.c index 4fe5538..c777b46 100644 --- a/freeglut/freeglut/src/mswin/fg_main_mswin.c +++ b/freeglut/freeglut/src/mswin/fg_main_mswin.c @@ -251,7 +251,8 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, GetCursorPos( &mouse_pos ); ScreenToClient( window->Window.Handle, &mouse_pos ); hwnd = ChildWindowFromPoint(window->Window.Handle, mouse_pos); - window = fgWindowByHandle(hwnd); + if (hwnd) /* can be NULL if mouse outside parent by the time we get here */ + window = fgWindowByHandle(hwnd); } if ( window )