From: Jihun Ha Date: Mon, 22 May 2017 10:58:53 +0000 (+0900) Subject: Filter out an exceptional case if a response payload of discovery is NULL X-Git-Tag: 1.3.0~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef4b9fb79acebee25b1d6e7445e4bf3fc89ebfee;p=platform%2Fupstream%2Fiotivity.git Filter out an exceptional case if a response payload of discovery is NULL If a response payload of discovery is NULL, which means discovery request is failed for some reason, it should not proceed a further operation. Only if a result of discovery request is OK, GET/PUT/POST requests can be performed, further. Change-Id: I95e79038dfae5e455f61db89aa9c7f3a724cee29 Signed-off-by: Jihun Ha Reviewed-on: https://gerrit.iotivity.org/gerrit/20245 Reviewed-by: Phil Coval Reviewed-by: Glen Youngjin Kim Reviewed-by: Ashok Babu Channa Tested-by: jenkins-iotivity --- diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp old mode 100644 new mode 100755 index 049fbc6d7..9381a8196 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp @@ -248,7 +248,7 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/, OIC_LOG(ERROR, TAG, "\n<====Callback Context for DISCOVERY fail====>"); } - if (clientResponse) + if (clientResponse && clientResponse->result == OC_STACK_OK) { OIC_LOG_V(INFO, TAG, "Device =============> Discovered @ %s:%d",