NULL check to create handle 19/47419/1
authorJiwon Park <jiwon44.park@samsung.com>
Sat, 23 May 2015 13:27:59 +0000 (22:27 +0900)
committerGukhwan Cho <gh78.cho@samsung.com>
Thu, 3 Sep 2015 08:08:07 +0000 (17:08 +0900)
Change-Id: I8ede3dc915c46d4c212f17eb2e6e5c6437824649
Signed-off-by: Jiwon Park <jiwon44.park@samsung.com>
client/ctsvc_client_service.c

index 62df6ad..ea2675a 100644 (file)
@@ -35,7 +35,7 @@ API int contacts_connect_with_flags(unsigned int flags)
        unsigned int id = ctsvc_client_get_pid();
 
        ret = ctsvc_client_handle_get_p_with_id(id, &contact);
-       if (CONTACTS_ERROR_NO_DATA == ret) {
+       if (NULL == contact) {
                ret = ctsvc_client_handle_create(id, &contact);
                RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_client_handle_create() Fail(%d)", ret);
        }
@@ -57,7 +57,7 @@ API int contacts_connect(void)
        unsigned int id = ctsvc_client_get_pid();
 
        ret = ctsvc_client_handle_get_p_with_id(id, &contact);
-       if (CONTACTS_ERROR_NO_DATA == ret) {
+       if (NULL == contact) {
                ret = ctsvc_client_handle_create(id, &contact);
                RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_client_handle_create() Fail(%d)", ret);
        }
@@ -100,7 +100,7 @@ API int contacts_connect_on_thread(void)
        unsigned int id = ctsvc_client_get_tid();
 
        ret = ctsvc_client_handle_get_p_with_id(id, &contact);
-       if (CONTACTS_ERROR_NO_DATA == ret) {
+       if (NULL == contact) {
                ret = ctsvc_client_handle_create(id, &contact);
                RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_client_handle_create() Fail(%d)", ret);
        }