From a9d63642923adaf3511c65562d8c13b4a5b32a83 Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Thu, 25 Jan 2024 22:08:16 +0100 Subject: Add null checks in password_hybrid.changed.connect signal --- main/src/ui/manage_accounts/dialog.vala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main/src') diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala index fb226702..d9939c8f 100644 --- a/main/src/ui/manage_accounts/dialog.vala +++ b/main/src/ui/manage_accounts/dialog.vala @@ -44,8 +44,10 @@ public class Dialog : Gtk.Dialog { image_button.clicked.connect(show_select_avatar); alias_hybrid.entry.changed.connect(() => { selected_account.alias = alias_hybrid.text; }); password_hybrid.entry.changed.connect(() => { - if (password_hybrid.text != "************") { - selected_account.password = password_hybrid.text; + string? pw_buffer; + pw_buffer = password_hybrid.text; + if (pw_buffer != null && pw_buffer.length > 0 && pw_buffer != "************") { + selected_account.password = pw_buffer; } }); -- cgit v1.2.3-70-g09d2