diff libpurple/log.c @ 18862:5b27ae2413b7

bug fix
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 10 Aug 2007 15:04:04 +0000
parents 873ee0038752
children 941965d6fd88
line wrap: on
line diff
--- a/libpurple/log.c	Fri Aug 10 13:28:12 2007 +0000
+++ b/libpurple/log.c	Fri Aug 10 15:04:04 2007 +0000
@@ -718,9 +718,9 @@
 		if (tmp < start)
 			g_string_append_len(newmsg, tmp, start - tmp);
 
-		idstr = g_datalist_get_data(&attributes, "id");
+		if ((idstr = g_datalist_get_data(&attributes, "id")) != NULL)
+			imgid = atoi(idstr);
 
-		imgid = atoi(idstr);
 		if (imgid != 0)
 		{
 			FILE *image_file;
@@ -735,6 +735,7 @@
 			if (image == NULL)
 			{
 				/* This should never happen. */
+				/* This *does* happen for failed Direct-IMs -DAA */
 				g_string_free(newmsg, TRUE);
 				g_return_val_if_reached((char *)msg);
 			}