From e55199597b8dba4a87d0f43745933e7be65c1b9a Mon Sep 17 00:00:00 2001 From: Konrad Date: Thu, 29 Jun 2017 22:38:12 +0200 Subject: [PATCH] Changed: Request handler for avatar return failure if an error occurred while obtaining data --- libresapi/src/api/IdentityHandler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libresapi/src/api/IdentityHandler.cpp b/libresapi/src/api/IdentityHandler.cpp index 2ddec6141..ced71f14f 100644 --- a/libresapi/src/api/IdentityHandler.cpp +++ b/libresapi/src/api/IdentityHandler.cpp @@ -600,13 +600,16 @@ void IdentityHandler::handleGetAvatar(Request& req, Response& resp) req.mStream << makeKeyValueReference("gxs_id", gxs_id); RsIdentityDetails details; - mRsIdentity->getIdDetails(RsGxsId(gxs_id), details); + bool got = mRsIdentity->getIdDetails(RsGxsId(gxs_id), details); std::string base64Avatar; Radix64::encode(details.mAvatar.mData, details.mAvatar.mSize, base64Avatar); resp.mDataStream << makeKeyValue("avatar", base64Avatar); - resp.setOk(); + if(got) + resp.setOk(); + else + resp.setFail(); } void IdentityHandler::handleSetBanNode(Request& req, Response& resp)