diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-05-02 12:18:47 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-05-02 13:00:08 +0000 |
commit | bc94ba4d1421b061e12eb187f553250223a1ff8d (patch) | |
tree | e373d7ae434ccf4d0a5ae6524d17cc7014e44421 /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #5486 (diff) | |
download | monero-bc94ba4d1421b061e12eb187f553250223a1ff8d.tar.xz |
wallet: distinguish between empty and absent attributes
Diffstat (limited to '')
-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 4076ae957..bd70b833b 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -2126,7 +2126,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) |