Fixed crash if app delegate method is called when SDL isn't initialized

main
Sam Lantinga 2024-02-25 13:38:47 -08:00
parent 9dbbf0a2f7
commit d211da75ac
1 changed files with 4 additions and 1 deletions

View File

@ -284,7 +284,10 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
- (void)screenParametersChanged:(NSNotification *)aNotification
{
Cocoa_UpdateDisplays(SDL_GetVideoDevice());
SDL_VideoDevice *device = SDL_GetVideoDevice();
if (device) {
Cocoa_UpdateDisplays(device);
}
}
- (void)localeDidChange:(NSNotification *)notification