aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-07-24 13:59:19 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-07-24 13:59:19 -0500
commit407683a38c604293c2ef076e3c9b1d4b9e90db2f (patch)
tree230ad18e700c788a37aa18250d528f559190e095 /src/wallet/wallet_rpc_server.cpp
parentMerge pull request #5507 (diff)
parentwallet: distinguish between empty and absent attributes (diff)
downloadmonero-407683a38c604293c2ef076e3c9b1d4b9e90db2f.tar.xz
Merge pull request #5513
bc94ba4 wallet: distinguish between empty and absent attributes (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r--src/wallet/wallet_rpc_server.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 47235dc44..9d3605d11 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -2102,7 +2102,12 @@ namespace tools
return false;
}
- res.value = m_wallet->get_attribute(req.key);
+ if (!m_wallet->get_attribute(req.key, res.value))
+ {
+ er.code = WALLET_RPC_ERROR_CODE_ATTRIBUTE_NOT_FOUND;
+ er.message = "Attribute not found.";
+ return false;
+ }
return true;
}
bool wallet_rpc_server::on_get_tx_key(const wallet_rpc::COMMAND_RPC_GET_TX_KEY::request& req, wallet_rpc::COMMAND_RPC_GET_TX_KEY::response& res, epee::json_rpc::error& er, const connection_context *ctx)