Skip to content

Commit

Permalink
Fixed rare crash when creating an X11 window
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 22, 2020
1 parent d12ea89 commit 589d636
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/video/x11/SDL_x11window.c
Expand Up @@ -1661,7 +1661,15 @@ SDL_bool
X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
{
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
Display *display = data->videodata->display;
Display *display;

if (!data) {
/* This sometimes happens in SDL_IBus_UpdateTextRect() while creating the window */
SDL_SetError("Window not initialized");
return SDL_FALSE;
}

display = data->videodata->display;

if (info->version.major == SDL_MAJOR_VERSION &&
info->version.minor == SDL_MINOR_VERSION) {
Expand Down

0 comments on commit 589d636

Please sign in to comment.