changeset 29211:091797665df5

There's no need to check type twice here. Also, g_return_if_reached is not correct since img==NULL is caused by invalid network input and not some programmer error.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 31 Dec 2009 04:13:55 +0000
parents 0b48f58e8c50
children d3298d8f67dd
files libpurple/protocols/msn/slp.c
diffstat 1 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slp.c	Thu Dec 31 00:33:12 2009 +0000
+++ b/libpurple/protocols/msn/slp.c	Thu Dec 31 04:13:55 2009 +0000
@@ -293,7 +293,7 @@
 		MsnSlpMessage *slpmsg;
 		MsnObject *obj;
 		char *msnobj_data;
-		PurpleStoredImage *img;
+		PurpleStoredImage *img = NULL;
 		int type;
 
 		/* Send Ok */
@@ -312,20 +312,13 @@
 		type = msn_object_get_type(obj);
 		g_free(msnobj_data);
 
-		if ((type != MSN_OBJECT_USERTILE) && (type != MSN_OBJECT_EMOTICON))
-		{
-			purple_debug_error("msn", "Wrong object?\n");
-			msn_object_destroy(obj);
-			g_return_if_reached();
-		}
-
 		if (type == MSN_OBJECT_EMOTICON) {
 			char *path;
 			path = g_build_filename(purple_smileys_get_storing_dir(),
 					obj->location, NULL);
 			img = purple_imgstore_new_from_file(path);
 			g_free(path);
-		} else {
+		} else if (type == MSN_OBJECT_USERTILE) {
 			img = msn_object_get_image(obj);
 			if (img)
 				purple_imgstore_ref(img);
@@ -335,7 +328,7 @@
 		if (img == NULL)
 		{
 			purple_debug_error("msn", "Wrong object.\n");
-			g_return_if_reached();
+			return;
 		}
 
 		/* DATA PREP */