changeset 29397:fff648ea95ae

Minor optimization / incorrect use prevention
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 18 Feb 2010 16:37:18 +0000
parents aacd0b257060
children ae1c7756f1bd
files libpurple/account.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Thu Feb 18 13:02:16 2010 +0000
+++ b/libpurple/account.c	Thu Feb 18 16:37:18 2010 +0000
@@ -2744,11 +2744,12 @@
 	char *who;
 
 	g_return_val_if_fail(name != NULL, NULL);
+	g_return_val_if_fail(protocol_id != NULL, NULL);
 
 	for (l = purple_accounts_get_all(); l != NULL; l = l->next) {
 		account = (PurpleAccount *)l->data;
-		if (protocol_id && !purple_strequal(account->protocol_id, protocol_id))
-		  continue;
+		if (!purple_strequal(account->protocol_id, protocol_id))
+			continue;
 
 		who = g_strdup(purple_normalize(account, name));
 		if (purple_strequal(purple_normalize(account, purple_account_get_username(account)), who)) {