From fd2fb3757add1d407bf9b8a46652712b9ca88fa7 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Wed, 16 Feb 2022 14:35:30 -0500 Subject: [PATCH] Try to avoid coredumping if zrpc object doesn't exist, which can happen if backend server is misbehaving --- src/controller.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/controller.cpp b/src/controller.cpp index dcccc01..63773a4 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -1987,7 +1987,7 @@ void Controller::refreshHUSHPrice() void Controller::shutdownhushd() { // Save the wallet and exit the lightclient library cleanly. - if (zrpc->haveConnection()) + if (zrpc && zrpc->haveConnection()) { QDialog d(main); Ui_ConnectionDialog connD; @@ -2010,7 +2010,7 @@ void Controller::shutdownhushd() connD.topIcon->setMovie(movie1); movie1->start(); connD.status->setText(QObject::tr("Please wait for SilentDragonLite to exit")); - connD.statusDetail->setText(QObject::tr("Waiting for hushd to exit")); + connD.statusDetail->setText(QObject::tr("Please wait for SilentDragonLite to exit")); } bool finished = false; @@ -2018,10 +2018,13 @@ void Controller::shutdownhushd() if (!finished) d.accept(); finished = true; + qDebug() << "saveWallet during shutdownhushd"; }); if (!finished) d.exec(); + } else { + qDebug() << "No zrpc object, unclean shutdown and unable to call saveWallet!"; } }