changeset 18862:5b27ae2413b7

bug fix
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 10 Aug 2007 15:04:04 +0000
parents 54e020a8b6b9
children f85e3866bf93 e7314d58ebe6
files libpurple/log.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
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);
 			}