Browse Source

Fixed crash if a window couldn't be created on Windows

Fixes https://github.com/libsdl-org/SDL/issues/11482

(cherry picked from commit 3415bc920ab54cc41708a0eafce30b915faf67e1)
Sam Lantinga 1 month ago
parent
commit
7a36aa37aa
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/video/windows/SDL_windowswindow.c

+ 1 - 1
src/video/windows/SDL_windowswindow.c

@@ -1311,7 +1311,7 @@ SDL_FullscreenResult WIN_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window
 #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
     SDL_DisplayData *displaydata = display->internal;
     SDL_WindowData *data = window->internal;
-    HWND hwnd = data->hwnd;
+    HWND hwnd = data ? data->hwnd : NULL;
     MONITORINFO minfo;
     DWORD style, styleEx;
     HWND top;