From 405ce5a876f96a4fbd136129269df0edeb4c7a55 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 13 Nov 2011 08:45:29 +0100 Subject: [PATCH] Add model null pointer check (solves issue #595 and https://github.com/laanwj/bitcoin-qt/issues/29) Missed this one before, which can be triggered in race condition if window event arrives before model is set --- src/qt/bitcoingui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 5ae3ce33..8641c723 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -478,11 +478,11 @@ void BitcoinGUI::error(const QString &title, const QString &message) void BitcoinGUI::changeEvent(QEvent *e) { #ifndef Q_WS_MAC // Ignored on Mac - if (e->type() == QEvent::WindowStateChange) + if(e->type() == QEvent::WindowStateChange) { - if (clientModel->getOptionsModel()->getMinimizeToTray()) + if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray()) { - if (isMinimized()) + if(isMinimized()) { hide(); e->ignore();