diff libpurple/log.c @ 18866:e7314d58ebe6

merge of '568907d26b94a41acc8768523cdc469bdf385d2c' and '90af3f4273c546393e7066ee5f281a8417cb3876'
author Will Thompson <will.thompson@collabora.co.uk>
date Fri, 10 Aug 2007 17:45:05 +0000
parents 5b27ae2413b7
children 941965d6fd88
line wrap: on
line diff
--- a/libpurple/log.c	Fri Aug 10 17:30:59 2007 +0000
+++ b/libpurple/log.c	Fri Aug 10 17:45:05 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);
 			}