Yair Zaslavsky has uploaded a new change for review. Change subject: core: Fixing NPE when group is assigned with permissions ......................................................................
core: Fixing NPE when group is assigned with permissions The patch associated with Idb1a7146c29eb74f97e10043d65b5a67f1430021 introduced a regression in assigning a group permissions. Prior to that patch the entity DbGroup did not exist, hence the CTOR of LdapGroup that has DbGroup did not exist as well. The memberOf initialization is fixed here for cases that the flows do not set the memberOf attribute Change-Id: If92ce2718a32658b4118e4e7f9334b631fa6c839 Signed-off-by: Yair Zaslavsky <yzasl...@redhat.com> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbGroup.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/LdapGroup.java 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/12/22612/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbGroup.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbGroup.java index 4038194..e4d8286 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbGroup.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbGroup.java @@ -42,7 +42,7 @@ name = ldapGroup.getname(); distinguishedName = ldapGroup.getDistinguishedName(); active = ldapGroup.isActive(); - memberOf = new HashSet<String>(ldapGroup.getMemberOf()); + memberOf = ldapGroup.getMemberOf() != null ? new HashSet<String>(ldapGroup.getMemberOf()) : null; } public Guid getId() { diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/LdapGroup.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/LdapGroup.java index d3b267b..69265a9 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/LdapGroup.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/LdapGroup.java @@ -34,7 +34,7 @@ domain = dbGroup.getDomain(); active = dbGroup.isActive(); distinguishedName = dbGroup.getDistinguishedName(); - memberOf = new ArrayList<String>(dbGroup.getMemberOf()); + memberOf = dbGroup.getMemberOf() != null ? new ArrayList<String>(dbGroup.getMemberOf()) : null; } public Guid getid() { -- To view, visit http://gerrit.ovirt.org/22612 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If92ce2718a32658b4118e4e7f9334b631fa6c839 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches