Try to avoid coredumping if zrpc object doesn't exist, which can happen if backend server is misbehaving
This commit is contained in:
@@ -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!";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user