summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 3f049340f..ae76813ab 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2991,7 +2991,10 @@ void Client::setIcon()
#ifdef WIN32
static SDL_SysWMinfo pInfo;
- SDL::getWindowWMInfo(mainGraphics->getWindow(), &pInfo);
+ if (mainGraphics)
+ SDL::getWindowWMInfo(mainGraphics->getWindow(), &pInfo);
+ else
+ SDL::getWindowWMInfo(nullptr, &pInfo);
// Attempt to load icon from .ico file
HICON icon = (HICON) LoadImage(nullptr, iconFile.c_str(),
IMAGE_ICON, 64, 64, LR_LOADFROMFILE);