[telepathy-gabble/master] create_msg_foreach: discard keys with an invalid type

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Aug 7 02:33:15 PDT 2009


---
 src/conn-location.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/conn-location.c b/src/conn-location.c
index 8ef31a7..31fd613 100644
--- a/src/conn-location.c
+++ b/src/conn-location.c
@@ -179,6 +179,15 @@ create_msg_foreach (gpointer tp_name,
       return;
     }
 
+  if (mapping != NULL && G_VALUE_TYPE (value) != mapping->type)
+    {
+      /* TODO: we should raise an error in that case */
+      DEBUG ("%s is supposed to be of type %s but is %s",
+          (const char *) tp_name, g_type_name (mapping->type),
+          G_VALUE_TYPE_NAME (value));
+      return;
+    }
+
   if (G_VALUE_TYPE (value) == G_TYPE_INT64)
     {
       GTimeVal timeval;
-- 
1.5.6.5




More information about the telepathy-commits mailing list