diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 4503ae5c3..a3b056d34 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -224,6 +224,10 @@ static void ConvertNSRect(NSScreen *screen, BOOL fullscreen, NSRect *r) static void ScheduleContextUpdates(SDL_WindowData *data) { + if (!data || !data->nscontexts) { + return; + } + NSOpenGLContext *currentContext = [NSOpenGLContext currentContext]; NSMutableArray *contexts = data->nscontexts; @synchronized (contexts) {