summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-30 01:38:06 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-30 19:53:08 +0300
commit8e244c7e5b6c98b1a6e67d4e387a9c231a42b15c (patch)
treea70f4d29fdc4b57e2204758c28139b20bd7473f5 /src/client.cpp
parente754d2d1f4f45238974d2136baf5eff0058784a4 (diff)
downloadplus-8e244c7e5b6c98b1a6e67d4e387a9c231a42b15c.tar.gz
plus-8e244c7e5b6c98b1a6e67d4e387a9c231a42b15c.tar.bz2
plus-8e244c7e5b6c98b1a6e67d4e387a9c231a42b15c.tar.xz
plus-8e244c7e5b6c98b1a6e67d4e387a9c231a42b15c.zip
Add some missing checks to window resize code.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 0e62d9a52..2d4de8a9f 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -167,7 +167,7 @@ volatile int frame_count = 0; /**< Counts the frames during one second */
volatile int cur_time;
volatile bool runCounters;
bool isSafeMode = false;
-int serverVersion;
+int serverVersion = 0;
int start_time;
int textures_count = 0;
@@ -2363,6 +2363,8 @@ void Client::resizeVideo(int width, int height)
width = std::max(640, width);
height = std::max(480, height);
+ if (!mainGraphics)
+ return;
if (mainGraphics->mWidth == width && mainGraphics->mHeight == height)
return;
@@ -2396,7 +2398,8 @@ void Client::resizeVideo(int width, int height)
if (mGame)
mGame->videoResized(width, height);
- gui->draw();
+ if (gui)
+ gui->draw();
// Since everything appears to have worked out, remember to store the
// new size in the configuration.