network: fix crashes in eap-method-simple
When the stored password is missing, we will crash passing NULL to a non-nullable GTK API function. Fixes #1905
This commit is contained in:
parent
5ba50dec58
commit
db3be4c498
1 changed files with 4 additions and 2 deletions
|
@ -200,7 +200,8 @@ static void
|
|||
set_username (EAPMethod *method, const gchar *username)
|
||||
{
|
||||
EAPMethodSimple *self = EAP_METHOD_SIMPLE (method);
|
||||
gtk_editable_set_text (GTK_EDITABLE (self->username_entry), username);
|
||||
if (username)
|
||||
gtk_editable_set_text (GTK_EDITABLE (self->username_entry), username);
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
|
@ -214,7 +215,8 @@ static void
|
|||
set_password (EAPMethod *method, const gchar *password)
|
||||
{
|
||||
EAPMethodSimple *self = EAP_METHOD_SIMPLE (method);
|
||||
gtk_editable_set_text (GTK_EDITABLE (self->password_entry), password);
|
||||
if (password)
|
||||
gtk_editable_set_text (GTK_EDITABLE (self->password_entry), password);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Add table
Reference in a new issue