[grilo] Check if key is NULL



commit 39012c578c89b967bdd0c23ed60afd8fd4605a3e
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Mon Jun 7 17:04:45 2010 +0200

    Check if key is NULL
    
    Add some checkpoints in GrlData functions to be sure key is not NULL.

 src/data/grl-data.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/data/grl-data.c b/src/data/grl-data.c
index 40912ea..e6c870c 100644
--- a/src/data/grl-data.c
+++ b/src/data/grl-data.c
@@ -173,6 +173,7 @@ const GValue *
 grl_data_get (GrlData *data, GrlKeyID key)
 {
   g_return_val_if_fail (GRL_IS_DATA (data), NULL);
+  g_return_val_if_fail (key, NULL);
 
   return g_hash_table_lookup (data->priv->data, key);
 }
@@ -194,7 +195,9 @@ void
 grl_data_set (GrlData *data, GrlKeyID key, const GValue *value)
 {
   GValue *copy = NULL;
+
   g_return_if_fail (GRL_IS_DATA (data));
+  g_return_if_fail (key);
 
   if (data->priv->overwrite ||
       g_hash_table_lookup (data->priv->data, key) == NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]