changeset 28469:caa94dfa37f1

Add assertions to purple_account_add_buddy; a NULL buddy is very bad. Refs #10115.
author Paul Aurich <paul@darkrain42.org>
date Sat, 29 Aug 2009 02:32:16 +0000
parents 635b28b527a2
children 1662dbdac18c
files libpurple/account.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Sat Aug 29 02:29:53 2009 +0000
+++ b/libpurple/account.c	Sat Aug 29 02:32:16 2009 +0000
@@ -2290,9 +2290,13 @@
 purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy)
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
-	PurpleConnection *gc = purple_account_get_connection(account);
+	PurpleConnection *gc;
 	PurplePlugin *prpl = NULL;
 
+	g_return_if_fail(account != NULL);
+	g_return_if_fail(buddy != NULL);
+
+	gc = purple_account_get_connection(account);
 	if (gc != NULL)
 	        prpl = purple_connection_get_prpl(gc);