[grilo] core: handle NULL as NOP for grl_data_*_for_id()
- From: Victor Toso <victortoso src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: handle NULL as NOP for grl_data_*_for_id()
- Date: Wed, 3 Oct 2018 09:37:46 +0000 (UTC)
commit 2be94f85ccc39039bbe391b5795582c148d757bd
Author: Victor Toso <me victortoso com>
Date: Mon Sep 3 12:38:49 2018 +0200
core: handle NULL as NOP for grl_data_*_for_id()
To avoid handling a value that is treated as NOP by
grl_data_set () anyway.
Signed-off-by: Victor Toso <victortoso gnome org>
src/data/grl-data.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/src/data/grl-data.c b/src/data/grl-data.c
index 8720349..e9317ae 100644
--- a/src/data/grl-data.c
+++ b/src/data/grl-data.c
@@ -658,6 +658,9 @@ grl_data_set_for_id (GrlData *data, const gchar *key_name, const GValue *value)
GrlRegistry *registry;
GrlKeyID key_id;
+ if (value == NULL)
+ return TRUE;
+
key_name = g_intern_string (key_name);
g_return_val_if_fail (is_canonical (key_name), FALSE);
@@ -703,6 +706,9 @@ grl_data_add_for_id (GrlData *data, const gchar *key_name, const GValue *value)
GrlRegistry *registry;
GrlKeyID key_id;
+ if (value == NULL)
+ return TRUE;
+
key_name = g_intern_string (key_name);
g_return_val_if_fail (is_canonical (key_name), FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]