Check the existence of save items before requesting to save 40/210440/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 19 Jul 2019 06:34:34 +0000 (15:34 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 19 Jul 2019 06:37:17 +0000 (15:37 +0900)
Change-Id: Idc4dd09273bb7fe626eb9f4a7bf50462c7052988
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
client/autofill.c

index f78b1be..4a744f0 100644 (file)
@@ -369,6 +369,7 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi)
     char *value = NULL;
     autofill_hint_e autofill_hint;
     bool sensitive_data;
+    unsigned int save_item_count = 0;
 
     if (!ah || !vi) {
         LOGW("[ERROR] Invalid parameter");
@@ -384,6 +385,13 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi)
         return AUTOFILL_ERROR_OPERATION_FAILED;
     }
 
+    save_item_count = eina_list_count(vi->autofill_save_item_list);
+
+    if (save_item_count == 0) {
+        LOGE("[ERROR] No save item in save view. Please check whether adding save item by calling autofill_save_view_info_add_item() or not");
+        return AUTOFILL_ERROR_OPERATION_FAILED;
+    }
+
     rpc_port_autofill_save_view_info_create(&vih);
     rpc_port_autofill_save_view_info_set_view_id(vih, vi->view_id);
     rpc_port_autofill_save_view_info_set_view_title(vih, vi->view_title);