[rygel-grilo] Send default value for unknown properties
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel-grilo] Send default value for unknown properties
- Date: Mon, 17 May 2010 19:36:54 +0000 (UTC)
commit c475b0477db97029a93b4dad3a9c3a8131f78d04
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Mon May 17 21:33:24 2010 +0200
Send default value for unknown properties
lib/media-server1-server.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/lib/media-server1-server.c b/lib/media-server1-server.c
index 7c0d558..7fc0320 100644
--- a/lib/media-server1-server.c
+++ b/lib/media-server1-server.c
@@ -255,7 +255,12 @@ properties_lookup_with_default (GHashTable *properties,
gptrarray_type_properties[3] = NULL;
}
- propvalue = g_hash_table_lookup (properties, property);
+ if (properties) {
+ propvalue = g_hash_table_lookup (properties, property);
+ } else {
+ propvalue = NULL;
+ }
+
if (propvalue) {
/* Make a copy and return it */
ret_value = g_new0 (GValue, 1);
@@ -429,12 +434,11 @@ get_property_value (MS1Server *server,
server->priv->data,
NULL);
g_free (id);
- if (!propresult) {
- return NULL;
- }
-
v = properties_lookup_with_default (propresult, property);
- g_hash_table_unref (propresult);
+
+ if (propresult) {
+ g_hash_table_unref (propresult);
+ }
}
return v;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]