Skip to content

Commit dd90429

Browse files
committed
gui: Show an error message if the restored wallet name is empty
The Restore Wallet dialog rejects wallet names that are empty, but was doing so silently. This is confusing, we should be presenting an error message to the user.
1 parent 796f18e commit dd90429

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/qt/bitcoingui.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,11 @@ void BitcoinGUI::createActions()
452452
//: Label of the input field where the name of the wallet is entered.
453453
QString label = tr("Wallet Name");
454454
QString wallet_name = QInputDialog::getText(this, title, label, QLineEdit::Normal, "", &wallet_name_ok);
455-
if (!wallet_name_ok || wallet_name.isEmpty()) return;
455+
if (!wallet_name_ok) return;
456+
if (wallet_name.isEmpty()) {
457+
QMessageBox::critical(nullptr, tr("Invalid Wallet Name"), tr("Wallet name cannot be empty"));
458+
return;
459+
}
456460

457461
auto activity = new RestoreWalletActivity(m_wallet_controller, this);
458462
connect(activity, &RestoreWalletActivity::restored, this, &BitcoinGUI::setCurrentWallet, Qt::QueuedConnection);

0 commit comments

Comments
 (0)