Skip to content

Commit 13c3a65

Browse files
promagjonasschnelli
authored andcommitted
Qt/Bugfix: fix handling default wallet with no name
1 parent d792e47 commit 13c3a65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/qt/rpcconsole.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ bool RPCConsole::RPCParseCommandLine(interfaces::Node* node, std::string &strRes
312312
std::string method = stack.back()[0];
313313
std::string uri;
314314
#ifdef ENABLE_WALLET
315-
if (walletID && !walletID->empty()) {
315+
if (walletID) {
316316
QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(*walletID));
317317
uri = "/wallet/"+std::string(encodedName.constData(), encodedName.length());
318318
}
@@ -425,7 +425,7 @@ void RPCExecutor::request(const QString &command, const QString &walletID)
425425
return;
426426
}
427427
std::string wallet_id = walletID.toStdString();
428-
if(!RPCConsole::RPCExecuteCommandLine(m_node, result, executableCommand, nullptr, &wallet_id))
428+
if (!RPCConsole::RPCExecuteCommandLine(m_node, result, executableCommand, nullptr, walletID.isNull() ? nullptr : &wallet_id))
429429
{
430430
Q_EMIT reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \""));
431431
return;
@@ -909,7 +909,7 @@ void RPCConsole::on_lineEdit_returnPressed()
909909
}
910910

911911
if (m_last_wallet_id != walletID) {
912-
if (walletID.isEmpty()) {
912+
if (walletID.isNull()) {
913913
message(CMD_REQUEST, tr("Executing command without any wallet"));
914914
} else {
915915
message(CMD_REQUEST, tr("Executing command using \"%1\" wallet").arg(walletID));

0 commit comments

Comments
 (0)