diff src/log.c @ 5528:c72213437829

[gaim-migrate @ 5928] Dario Sarango (darius_wolfson) writes: "Patch to fix bug #743397 I added some snity checks when removing a log file, to avoid gai segfaulting when removing an invalid/non-existing log file." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 26 May 2003 04:28:11 +0000
parents ad445074d239
children 80e4ba770f97
line wrap: on
line diff
--- a/src/log.c	Mon May 26 04:26:24 2003 +0000
+++ b/src/log.c	Mon May 26 04:28:11 2003 +0000
@@ -28,6 +28,19 @@
 {
 	struct gaim_conversation *cnv = gaim_find_conversation(a->name);
 
+	/* Added the following if statements for sanity check */
+	if (!a)
+	{
+		gaim_notify_error (NULL, NULL, _("Error in specifying buddy conversation."), NULL);
+		return;
+	}
+	cnv = gaim_find_conversation(a->name);
+	if (!cnv)
+	{
+		gaim_notify_error (NULL, NULL, _("Unable to find conversation log"), NULL);
+		return;
+	}
+
 	log_conversations = g_list_remove(log_conversations, a);
 
 	save_prefs();