diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-07-24 13:59:19 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-07-24 13:59:19 -0500 |
commit | 407683a38c604293c2ef076e3c9b1d4b9e90db2f (patch) | |
tree | 230ad18e700c788a37aa18250d528f559190e095 /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #5507 (diff) | |
parent | wallet: distinguish between empty and absent attributes (diff) | |
download | monero-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.cpp | 7 |
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) |