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/gui/gui.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gui/gui.cpp') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index e441111a9..1d8b45872 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -290,11 +290,14 @@ void Gui::videoResized() { WindowContainer *top = static_cast(getTop()); - int oldWidth = top->getWidth(); - int oldHeight = top->getHeight(); + if (top) + { + int oldWidth = top->getWidth(); + int oldHeight = top->getHeight(); - top->setSize(mainGraphics->mWidth, mainGraphics->mHeight); - top->adjustAfterResize(oldWidth, oldHeight); + top->setSize(mainGraphics->mWidth, mainGraphics->mHeight); + top->adjustAfterResize(oldWidth, oldHeight); + } } void Gui::setUseCustomCursor(bool customCursor) -- cgit v1.2.3-60-g2f50