pidgin/pidgin

Fix a warning when opening the new IM dialog.

16 months ago, Elliott Sales de Andrade
4adf32217c85
Parents 905872c9dd7a
Children 3377280a4a8d
Fix a warning when opening the new IM dialog.
--- a/pidgin/gtkdialogs.c Tue Dec 10 04:43:23 2019 +0000
+++ b/pidgin/gtkdialogs.c Thu Dec 19 00:18:44 2019 -0500
@@ -270,13 +270,15 @@
PurpleAccount *account;
PurpleProtocol *protocol;
const char *username;
- gboolean valid;
+ gboolean valid = FALSE;
account = purple_request_fields_get_account(fields, "account");
protocol = purple_protocols_find(purple_account_get_protocol_id(account));
username = purple_request_fields_get_string(fields, "screenname");
- valid = purple_validate(protocol, username);
+ if (username) {
+ valid = purple_validate(protocol, username);
+ }
if (errmsg && !valid)
*errmsg = g_strdup(_("Invalid username"));