diff finch/plugins/gnttinyurl.c @ 26987:cd78ea46e9bd

merge of '7c614b09b72037ebd86c03fbbeac7794a155547b' and 'af18689b86389686230fc6ce83cbba52690ce0cb'
author Paul Aurich <paul@darkrain42.org>
date Sat, 30 May 2009 00:32:50 +0000
parents 0f1b41c2f835
children 6aa8e64fdbb7
line wrap: on
line diff
--- a/finch/plugins/gnttinyurl.c	Sat May 30 00:21:37 2009 +0000
+++ b/finch/plugins/gnttinyurl.c	Sat May 30 00:32:50 2009 +0000
@@ -228,12 +228,15 @@
 	if (!(*flags & PURPLE_MESSAGE_RECV) || *flags & PURPLE_MESSAGE_INVISIBLE)
 		return FALSE;
 
-	t = g_string_new(*message);
 	urls = purple_conversation_get_data(conv, "TinyURLs");
 	if (urls != NULL) /* message was cancelled somewhere? Reset. */
 		g_list_foreach(urls, free_urls, NULL);
 	g_list_free(urls);
-	urls = extract_urls(t->str);
+	urls = extract_urls(*message);
+	if (!urls)
+		return FALSE;
+
+	t = g_string_new(*message);
 	g_free(*message);
 	for (iter = urls; iter; iter = iter->next) {
 		if (g_utf8_strlen((char *)iter->data, -1) >= purple_prefs_get_int(PREF_LENGTH)) {