From 9c9f5b4d8ea1a31fdb0e6b545ea7fa7c133a61fd Mon Sep 17 00:00:00 2001 From: Rafal Walczyna Date: Tue, 17 Apr 2018 14:39:23 +0200 Subject: [PATCH] [IoTcon] Fix query creation for requests [Bug] query was not created properly when there was no resource interface set [Verification] 100% passrate on TM1 Change-Id: Iea1db9418fe10e9fad56a9bb7de1c34c95cbc5dd Signed-off-by: Rafal Walczyna --- src/iotcon/iotcon_utils.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/iotcon/iotcon_utils.cc b/src/iotcon/iotcon_utils.cc index 70546a4..abbe5d8 100644 --- a/src/iotcon/iotcon_utils.cc +++ b/src/iotcon/iotcon_utils.cc @@ -1106,11 +1106,14 @@ common::TizenResult IotconUtils::QueryToJson(iotcon_query_h query, picojson::obj { // resourceInterface char* interface = nullptr; - auto result = ConvertIotconError(iotcon_query_get_interface(query, &interface)); - if (!result || !interface) { - LogAndReturnTizenError(result, ("iotcon_query_get_interface() failed")); + int err_code = iotcon_query_get_interface(query, &interface); + if (IOTCON_ERROR_NONE != err_code) { + // if no interface is set to query we continue execution to set other values + LoggerW("iotcon_query_get_interface() failed: %d, ignoring resource interface in query", + err_code); + } else { + out->insert(std::make_pair(kResourceInterface, picojson::value{interface})); } - out->insert(std::make_pair(kResourceInterface, picojson::value{interface})); } { -- 2.7.4