From f3a612f9016fe1f59c73d6059274bea8025b8940 Mon Sep 17 00:00:00 2001 From: furszy Date: Wed, 28 Feb 2024 09:47:20 -0300 Subject: 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()'. --- src/qt/bitcoingui.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qt/bitcoingui.cpp') 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) -- cgit v1.2.3