aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-09-25 09:44:50 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-09-25 09:47:01 +0200
commitc4998661e4e4365e079b51a872f2d555a5a7837c (patch)
treed6728f311c0823d9a209bdb0ee3d1e9d6153fc29 /src
parentea69592a2f261dba37d551c0ac77e93ce00b37c3 (diff)
parente6beedc496093d98ba40500fd12bcb191c87bf6e (diff)
Merge pull request #4958
e6beedc [Qt] add more NULL pointer checks in bitcoingui (Philip Kaufmann)
Diffstat (limited to 'src')
-rw-r--r--src/qt/bitcoingui.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index dd5192982e..443bed14d7 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -662,6 +662,9 @@ void BitcoinGUI::setNumConnections(int count)
void BitcoinGUI::setNumBlocks(int count)
{
+ if(!clientModel)
+ return;
+
// Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text)
statusBar()->clearMessage();
@@ -832,7 +835,7 @@ void BitcoinGUI::changeEvent(QEvent *e)
#ifndef Q_OS_MAC // Ignored on Mac
if(e->type() == QEvent::WindowStateChange)
{
- if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray())
+ if(clientModel && clientModel->getOptionsModel() && clientModel->getOptionsModel()->getMinimizeToTray())
{
QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);
if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
@@ -847,16 +850,16 @@ void BitcoinGUI::changeEvent(QEvent *e)
void BitcoinGUI::closeEvent(QCloseEvent *event)
{
- if(clientModel)
- {
#ifndef Q_OS_MAC // Ignored on Mac
+ if(clientModel && clientModel->getOptionsModel())
+ {
if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
!clientModel->getOptionsModel()->getMinimizeOnClose())
{
QApplication::quit();
}
-#endif
}
+#endif
QMainWindow::closeEvent(event);
}
@@ -917,8 +920,7 @@ bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient)
gotoSendCoinsPage();
return true;
}
- else
- return false;
+ return false;
}
void BitcoinGUI::setEncryptionStatus(int status)