Browse Source

Try to avoid coredumping if zrpc object doesn't exist, which can happen if backend server is misbehaving

pull/84/head
Duke Leto 2 years ago
parent
commit
fd2fb3757a
  1. 7
      src/controller.cpp

7
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!";
}
}

Loading…
Cancel
Save