summaryrefslogtreecommitdiff
path: root/json-glib/json-array.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2012-10-26 10:59:16 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2012-10-26 11:12:58 +0100
commitbf273f396c640c17da9f742433b4855232b2062e (patch)
tree78d0c53e054fe8199d9ec7fd70503561df785768 /json-glib/json-array.c
parent2dec8604ee58571ccc902aeb27004adf6a436ff5 (diff)
downloadjson-glib-bf273f396c640c17da9f742433b4855232b2062e.tar.gz
array: Relax add_string_element() preconditions
The add_string_element() allows passing a NULL string as a shortcut to create a 'null' node; the preconditions on the arguments are too strict.
Diffstat (limited to 'json-glib/json-array.c')
-rw-r--r--json-glib/json-array.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/json-glib/json-array.c b/json-glib/json-array.c
index 44caf1e..f9d641e 100644
--- a/json-glib/json-array.c
+++ b/json-glib/json-array.c
@@ -556,9 +556,8 @@ json_array_add_string_element (JsonArray *array,
JsonNode *node;
g_return_if_fail (array != NULL);
- g_return_if_fail (value != NULL);
- if (value != NULL)
+ if (value != NULL && *value != '\0')
{
node = json_node_new (JSON_NODE_VALUE);
json_node_set_string (node, value);