summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-10 02:52:31 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-10 02:52:31 +0300
commit51fa913783cce22eacb439c8d671c7aaa1647898 (patch)
tree59246b9a93dcd4776413392ab0765cae382c0cd5 /src/client.cpp
parent2317fbe9d29f5bea76a2ba05b40841b11de1a6f2 (diff)
downloadmanaplus-51fa913783cce22eacb439c8d671c7aaa1647898.tar.gz
manaplus-51fa913783cce22eacb439c8d671c7aaa1647898.tar.bz2
manaplus-51fa913783cce22eacb439c8d671c7aaa1647898.tar.xz
manaplus-51fa913783cce22eacb439c8d671c7aaa1647898.zip
fix icon loading on windows.
Diffstat (limited to 'src/client.cpp')
-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);