changeset 13637:83ec59aefbe5

[gaim-migrate @ 16035] Fix Coverity CID 109, if we get a topic for a channel that doesn't exist, there's no point continuing and trying to set that topic committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 15 Apr 2006 14:40:55 +0000
parents 293088b65dac
children a376b680ae84
files src/protocols/irc/msgs.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/msgs.c	Sat Apr 15 14:29:30 2006 +0000
+++ b/src/protocols/irc/msgs.c	Sat Apr 15 14:40:55 2006 +0000
@@ -297,6 +297,12 @@
 	char *chan, *topic, *msg, *nick, *tmp, *tmp2;
 	GaimConversation *convo;
 
+	convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, chan, irc->account);
+	if (!convo) {
+		gaim_debug(GAIM_DEBUG_ERROR, "irc", "Got a topic for %s, which doesn't exist\n", chan);
+		return;
+	}
+
 	if (!strcmp(name, "topic")) {
 		chan = args[0];
 		topic = irc_mirc2txt (args[1]);
@@ -305,11 +311,6 @@
 		topic = irc_mirc2txt (args[2]);
 	}
 
-	convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, chan, irc->account);
-	if (!convo) {
-		gaim_debug(GAIM_DEBUG_ERROR, "irc", "Got a topic for %s, which doesn't exist\n", chan);
-	}
-
 	/* If this is an interactive update, print it out */
 	tmp = g_markup_escape_text(topic, -1);
 	tmp2 = gaim_markup_linkify(tmp);