SDL: avoid assert with SDL debug builds

This commit is contained in:
athrxx 2021-08-15 16:15:14 +02:00
parent aea6a243fb
commit 95f1b010f8

View File

@ -350,7 +350,8 @@ bool OpenGLSdlGraphicsManager::loadVideoMode(uint requestedWidth, uint requested
Common::Rect desktopRes = _window->getDesktopResolution();
#if SDL_VERSION_ATLEAST(2, 0, 0)
bool _isMaximized = (SDL_GetWindowFlags(_window->getSDLWindow()) & SDL_WINDOW_MAXIMIZED);
SDL_Window *window = _window->getSDLWindow();
bool _isMaximized = window ? (SDL_GetWindowFlags(window) & SDL_WINDOW_MAXIMIZED) : false;
if (_isMaximized && ConfMan.hasKey("window_maximized_width", Common::ConfigManager::kApplicationDomain) && ConfMan.hasKey("window_maximized_height", Common::ConfigManager::kApplicationDomain)) {
// Set the window size to the values stored when the window was maximized
// for the last time.