diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 37ce7697e6d9f..2b1ceb97d6bce 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -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;