diff libpurple/protocols/myspace/message.c @ 18908:6541b0edee26

Fix some assertion failures, that should really not be assertions. Found by using msimprpl with nullclient.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Sun, 12 Aug 2007 18:20:24 +0000
parents 3f95e691bad2
children c32fcdef2809
line wrap: on
line diff
--- a/libpurple/protocols/myspace/message.c	Sun Aug 12 18:11:29 2007 +0000
+++ b/libpurple/protocols/myspace/message.c	Sun Aug 12 18:20:24 2007 +0000
@@ -1108,7 +1108,8 @@
  *
  * @param name Name of element.
  *
- * @return gchar * The data as a string. Caller must g_free().
+ * @return gchar * The data as a string, or NULL if not found. 
+ *     Caller must g_free().
  *
  * Note that msim_msg_pack_element_data() is similar, but returns a string
  * for inclusion into a raw protocol string (escaped and everything).
@@ -1120,7 +1121,9 @@
 	MsimMessageElement *elem;
 
 	elem = msim_msg_get(msg, name);
-	g_return_val_if_fail(elem != NULL , NULL);
+	if (!elem) {
+		return NULL;
+	}
 
 	switch (elem->type) {
 		case MSIM_TYPE_INTEGER: