From 4fbb944f132eb886a6f5b350e5a14a4fe380aacf Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 11 Jul 2015 00:12:09 +0300 Subject: Add missing checks into gui. --- src/gui/widgets/window.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets/window.cpp') 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) { -- cgit v1.2.3-70-g09d2