changeset 22328:5fd8b4b4c6bd

I'm going to pretend this solves all my problems, except I can't see how these would ever be called with a NULL account and my logs show no sign that they are either. However, I haven't crashed since I made this change. References #4814
author Stu Tomlinson <stu@nosnilmot.com>
date Tue, 26 Feb 2008 14:02:06 +0000
parents dc47e908965f
children b630d1d4d64f
files libpurple/account.c
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Tue Feb 26 13:53:22 2008 +0000
+++ b/libpurple/account.c	Tue Feb 26 14:02:06 2008 +0000
@@ -2368,8 +2368,13 @@
 set_current_error(PurpleAccount *account,
                   PurpleConnectionErrorInfo *new_err)
 {
-	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
-	PurpleConnectionErrorInfo *old_err = priv->current_error;
+	PurpleAccountPrivate *priv;
+	PurpleConnectionErrorInfo *old_err;
+
+	g_return_if_fail(account != NULL);
+
+	priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
+	old_err = priv->current_error;
 
 	if(new_err == old_err)
 		return;
@@ -2393,8 +2398,14 @@
                     const gchar *description,
                     gpointer unused)
 {
-	PurpleAccount *account = purple_connection_get_account(gc);
-	PurpleConnectionErrorInfo *err = g_new0(PurpleConnectionErrorInfo, 1);
+	PurpleAccount *account;
+	PurpleConnectionErrorInfo *err;
+
+	account = purple_connection_get_account(gc);
+
+	g_return_if_fail(account != NULL);
+
+	err = g_new0(PurpleConnectionErrorInfo, 1);
 
 	err->type = type;
 	err->description = g_strdup(description);