aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpc/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/rpc/util.cpp')
-rw-r--r--src/wallet/rpc/util.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/rpc/util.cpp b/src/wallet/rpc/util.cpp
index b80f86ddc9..31435a69ba 100644
--- a/src/wallet/rpc/util.cpp
+++ b/src/wallet/rpc/util.cpp
@@ -132,7 +132,10 @@ const LegacyScriptPubKeyMan& EnsureConstLegacyScriptPubKeyMan(const CWallet& wal
std::string LabelFromValue(const UniValue& value)
{
- std::string label = value.get_str();
+ static const std::string empty_string;
+ if (value.isNull()) return empty_string;
+
+ const std::string& label{value.get_str()};
if (label == "*")
throw JSONRPCError(RPC_WALLET_INVALID_LABEL_NAME, "Invalid label name");
return label;