aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2024-02-28 09:47:20 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2024-02-28 17:58:47 -0300
commitf3a612f9016fe1f59c73d6059274bea8025b8940 (patch)
treee633a0fcae1e101b358b17f5779790ab2fba3d88 /src/qt/bitcoingui.cpp
parentba907f96ad37c09c49c0e1532fad118fcb8dd4a8 (diff)
downloadbitcoin-f3a612f9016fe1f59c73d6059274bea8025b8940.tar.xz
gui: guard accessing a nullptr 'clientModel'
During shutdown, already queue events dispatched from the backend such 'numConnectionsChanged' and 'networkActiveChanged' could try to access the clientModel object, which might not exist because we manually delete it inside 'BitcoinApplication::requestShutdown()'.
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index ad80922c8b..5f132b817e 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -989,6 +989,7 @@ void BitcoinGUI::gotoLoadPSBT(bool from_clipboard)
void BitcoinGUI::updateNetworkState()
{
+ if (!clientModel) return;
int count = clientModel->getNumConnections();
QString icon;
switch(count)