Skip to content
Snippets Groups Projects
Commit 81f929d1 authored by Simon McVittie's avatar Simon McVittie
Browse files

json-utils: Don't critical if an array contains a non-string


json_array_get_string_element() raises a critical warning if the element
exists but isn't a string. json_node_get_string() is more tolerant.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 1b94b6e7
No related branches found
No related tags found
1 merge request!164Preparation for !158
......@@ -99,7 +99,6 @@ _srt_json_object_dup_strv_member (JsonObject *json_obj,
{
JsonArray *array;
guint length;
const gchar *element;
gchar **ret = NULL;
g_return_val_if_fail (json_obj != NULL, NULL);
......@@ -118,7 +117,8 @@ _srt_json_object_dup_strv_member (JsonObject *json_obj,
for (guint i = 0; i < length; i++)
{
element = json_array_get_string_element (array, i);
JsonNode *node = json_array_get_element (array, i);
const gchar *element = json_node_get_string (node);
if (element == NULL)
element = placeholder;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment