diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:09 +0300 |
commit | 4fbb944f132eb886a6f5b350e5a14a4fe380aacf (patch) | |
tree | 6df2ed96430610ee7c35a7ca4902bbdade0e8e34 /src/gui/widgets/window.cpp | |
parent | 1dc012a3bb44218778568e8f80c4e9b445802195 (diff) | |
download | manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.gz manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.bz2 manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.xz manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.zip |
Add missing checks into gui.
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r-- | src/gui/widgets/window.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 2316af653..73355e3fc 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -641,11 +641,14 @@ void Window::widgetResized(const Event &event A_UNUSED) if (showClose) { const Image *const button = mSkin->getCloseImage(false); - const int buttonWidth = button->getWidth(); - mCloseRect.x = mDimension.width - buttonWidth - mClosePadding; - mCloseRect.y = mClosePadding; - mCloseRect.width = buttonWidth; - mCloseRect.height = button->getHeight(); + if (button) + { + const int buttonWidth = button->getWidth(); + mCloseRect.x = mDimension.width - buttonWidth - mClosePadding; + mCloseRect.y = mClosePadding; + mCloseRect.width = buttonWidth; + mCloseRect.height = button->getHeight(); + } } if (mStickyButton) { |