Fixed crash if SDL_GetVideoDisplayForWindow() returns NULL

This commit is contained in:
Sam Lantinga 2024-11-13 10:45:01 -08:00
parent 20cd4290d7
commit 9a4ae4b9ed

View file

@ -2406,7 +2406,9 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
window->undefined_y = undefined_y;
SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window);
SDL_SetWindowHDRProperties(window, &display->HDR, false);
if (display) {
SDL_SetWindowHDRProperties(window, &display->HDR, false);
}
if (flags & SDL_WINDOW_FULLSCREEN || IsFullscreenOnly(_this)) {
SDL_Rect bounds;