modify iotcon_representation_get_children_count() 27/57227/2 accepted/tizen/mobile/20160119.043052 accepted/tizen/tv/20160119.043107 accepted/tizen/wearable/20160119.043130 submit/tizen/20160119.011209
authoryoungman <yman.jung@samsung.com>
Mon, 18 Jan 2016 06:30:03 +0000 (15:30 +0900)
committeryoungman <yman.jung@samsung.com>
Mon, 18 Jan 2016 06:32:32 +0000 (15:32 +0900)
Change-Id: Ia4d4d41161fa245ee977a6a5e7b8b0902ef34abc
Signed-off-by: youngman <yman.jung@samsung.com>
lib/icl-representation.c

index aadaebacbb5b9cdc0c52cf2b110764be9419dce2..26ddddd77cf5641e6fdb914fcefacf7009526d63 100644 (file)
@@ -250,9 +250,10 @@ API int iotcon_representation_get_children_count(iotcon_representation_h parent,
 {
        RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == count, IOTCON_ERROR_INVALID_PARAMETER);
-       RETV_IF(NULL == parent->children, IOTCON_ERROR_INVALID_PARAMETER);
-
-       *count = g_list_length(parent->children);
+       if (NULL == parent->children)
+               *count = 0;
+       else
+               *count = g_list_length(parent->children);
 
        return IOTCON_ERROR_NONE;
 }