From 792acf268286fd4741a218427e66780cb31f2aa5 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 7 Mar 2025 10:56:05 +0600 Subject: [PATCH] Test fix for crash --- source/ubl-settings-usergroups-user.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/ubl-settings-usergroups-user.c b/source/ubl-settings-usergroups-user.c index c846e89..c7ced30 100644 --- a/source/ubl-settings-usergroups-user.c +++ b/source/ubl-settings-usergroups-user.c @@ -333,6 +333,12 @@ void on_user_save(GtkWidget *self, dictionary *dict){ int do_not_check_actve = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userDontCheckCheck)); login = (char*)gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry)); + if (yon_char_is_empty(login)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->userLoginEntry); + return; + + } if (login[0]>'0'&&login[0]<'9'&&!do_not_check_actve){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),USER_BEGINS_WITH_DIGIT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_highlight_incorrect(window->userLoginEntry); @@ -511,7 +517,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){ if (!yon_char_is_empty(window->old_username)&&strcmp(window->old_username,login)){ yon_config_remove_by_key(USERADD(window->old_username)); } - if (strcmp(window->old_password,password)){ + if (window->old_password&&strcmp(window->old_password,password)){ final_command = yon_config_parameter_prepare_command(dull_parameter_get_command,NULL,"users",USERSHADOW(login)); yon_config_register(USERSHADOW(login),final_command,shadow_string); if (!yon_char_is_empty(window->old_username)&&strcmp(window->old_username,login)){