From 8e244c7e5b6c98b1a6e67d4e387a9c231a42b15c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 30 Jan 2012 01:38:06 +0300 Subject: Add some missing checks to window resize code. --- src/client.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client.cpp') 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. -- cgit v1.2.3-70-g09d2