Fix the svace 2.2 issue 29/102929/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 6 Dec 2016 08:50:50 +0000 (17:50 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 6 Dec 2016 23:59:57 +0000 (08:59 +0900)
Change-Id: I74190c7492f63eabc32c13540f928a937258e0fb
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/bt-share-ui-ipc.c

index e06d9a0..facf293 100644 (file)
@@ -524,8 +524,10 @@ static void __bt_add_tr_data_list(bt_share_appdata_t *ad, int transfer_type)
 
                if (info == NULL) {
                        next = g_slist_next(next);
-                       if (tr_data_list)
-                               tr_data_list = g_slist_next(tr_data_list);
+                       tr_data_list = g_slist_next(tr_data_list);
+                       if (tr_data_list == NULL)
+                               break;
+
                        if (git)
                                git = elm_genlist_item_next_get(git);
 
@@ -576,15 +578,18 @@ static void __bt_add_tr_data_list(bt_share_appdata_t *ad, int transfer_type)
                        // Update data in list
                        bt_tr_data_t *list_info = NULL;
                        list_info = tr_data_list->data;
-                       if (list_info->id == info->id) {
-                               list_info->timestamp = info->timestamp;
-                               list_info->tr_status = info->tr_status;
-                               list_info->size = info->size;
-                               if (list_info->type == NULL)
-                                       list_info->type = g_strdup(info->type);
-
-                               if (list_info->tr_status == BT_TRANSFER_ONGOING)
-                                       ad->current_item = git;
+
+                       if (list_info) {
+                               if (list_info->id == info->id) {
+                                       list_info->timestamp = info->timestamp;
+                                       list_info->tr_status = info->tr_status;
+                                       list_info->size = info->size;
+                                       if (list_info->type == NULL)
+                                               list_info->type = g_strdup(info->type);
+
+                                       if (list_info->tr_status == BT_TRANSFER_ONGOING)
+                                               ad->current_item = git;
+                               }
                        }
                }
 
@@ -592,8 +597,8 @@ static void __bt_add_tr_data_list(bt_share_appdata_t *ad, int transfer_type)
                if (next == NULL)
                        break;
 
-               if (tr_data_list)
-                       tr_data_list = g_slist_next(tr_data_list);
+               tr_data_list = g_slist_next(tr_data_list);
+
                if (git)
                        git = elm_genlist_item_next_get(git);
        }