Static analysis fix: dereference of a NULL pointer.

This commit is contained in:
Ryan C. Gordon 2014-03-20 11:22:57 -04:00
parent b99a6253da
commit 84b919a2a7

View File

@ -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()];