JsonArray *keyword_arr = NULL;
int arr_len = 0;
int keyword_arr_len = 0;
+ const char *keyword = NULL;
JsonNode *root = NULL;
JsonObject *root_obj = NULL;
goto free_memory;
for (int j = 0; j < keyword_arr_len; j++) {
- sticker_info->keyword = g_list_append(sticker_info->keyword, strdup((const char *)json_array_get_string_element(keyword_arr, j)));
+ keyword = json_array_get_string_element(keyword_arr, j);
+ if (keyword)
+ sticker_info->keyword = g_list_append(sticker_info->keyword, strdup(keyword));
}
ret = stickerd_db_insert_sticker_info(&record_id, sticker_info);
}
return ret;
-}
\ No newline at end of file
+}