diff options
Diffstat (limited to 'src/wallet/rpc/util.cpp')
-rw-r--r-- | src/wallet/rpc/util.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/rpc/util.cpp b/src/wallet/rpc/util.cpp index 26270f23ed..d5f62dbd77 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; |