changeset 30212:51d5ec7b1699

Only call failure_cb if it exists for the [gs]et_public_alias functions. Craig "charding" Harding discovered (read: ran into the crash) this
author Paul Aurich <paul@darkrain42.org>
date Fri, 18 Jun 2010 20:12:41 +0000
parents 738741a7a692
children 597840eccfa7
files ChangeLog.API libpurple/account.c
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Thu Jun 17 21:21:30 2010 +0000
+++ b/ChangeLog.API	Fri Jun 18 20:12:41 2010 +0000
@@ -1,6 +1,11 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
 version 2.7.2 (??/??/????):
+	libpurple:
+		Fixed:
+		* purple_account_[gs]et_public_alias no longer crash when
+		  called for a protocol that doesn't support the underlying
+		  calls and the caller does not specify a failure callback.
 
 version 2.7.1 (05/29/2010):
 	* No changes
--- a/libpurple/account.c	Thu Jun 17 21:21:30 2010 +0000
+++ b/libpurple/account.c	Fri Jun 18 20:12:41 2010 +0000
@@ -1819,7 +1819,7 @@
 
 	if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, set_public_alias))
 		prpl_info->set_public_alias(gc, alias, success_cb, failure_cb);
-	else {
+	else if (failure_cb) {
 		struct public_alias_closure *closure =
 				g_new0(struct public_alias_closure, 1);
 		closure->account = account;
@@ -1859,7 +1859,7 @@
 
 	if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_public_alias))
 		prpl_info->get_public_alias(gc, success_cb, failure_cb);
-	else {
+	else if (failure_cb) {
 		struct public_alias_closure *closure =
 				g_new0(struct public_alias_closure, 1);
 		closure->account = account;