diff --git a/src/main/java/org/isf/menu/gui/UserEdit.java b/src/main/java/org/isf/menu/gui/UserEdit.java index 2c444058bd..55fa9c1833 100644 --- a/src/main/java/org/isf/menu/gui/UserEdit.java +++ b/src/main/java/org/isf/menu/gui/UserEdit.java @@ -340,20 +340,24 @@ private JComboBox getUserGroupComboBox() { if (userGroupComboBox == null) { userGroupComboBox = new JComboBox<>(); try { - List group = userBrowsingManager.getUserGroup(); + List groups = userBrowsingManager.getUserGroup(); if (insert) { - if (group != null) { - for (UserGroup elem : group) { - userGroupComboBox.addItem(elem); + if (groups != null) { + for (UserGroup group : groups) { + if (!group.isDeleted()) { + userGroupComboBox.addItem(group); + } } } } else { UserGroup selectedUserGroup = null; - if (group != null) { - for (UserGroup elem : group) { - userGroupComboBox.addItem(elem); - if (user.getUserGroupName().equals(elem)) { - selectedUserGroup = elem; + if (groups != null) { + for (UserGroup group : groups) { + if (!group.isDeleted()) { + userGroupComboBox.addItem(group); + if (user.getUserGroupName().equals(group)) { + selectedUserGroup = group; + } } } }