From 84b919a2a794c1526cde5fb512ee525d9eae69df Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 20 Mar 2014 11:22:57 -0400 Subject: [PATCH] Static analysis fix: dereference of a NULL pointer. --- src/video/cocoa/SDL_cocoawindow.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index a55ab4967..9e6edbb76 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -1464,9 +1464,7 @@ Cocoa_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint); } - if ( window->flags & SDL_WINDOW_FULLSCREEN ) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - + if ( data && (window->flags & SDL_WINDOW_FULLSCREEN) ) { if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { /* OpenGL is rendering to the window, so make it visible! */ [data->nswindow setLevel:CGShieldingWindowLevel()];