directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-core git commit: FC-64 - npe caused by malfunctioned read
Date Wed, 11 Feb 2015 18:19:39 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master b5cb0d9de -> f397ef2eb


FC-64 - npe caused by malfunctioned read


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/f397ef2e
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/f397ef2e
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/f397ef2e

Branch: refs/heads/master
Commit: f397ef2eb7aeeb5f479d76e003263fe6318311a1
Parents: b5cb0d9
Author: Shawn McKinney <smckinney@apache.org>
Authored: Wed Feb 11 12:19:26 2015 -0600
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Wed Feb 11 12:19:26 2015 -0600

----------------------------------------------------------------------
 .../apache/directory/fortress/core/rbac/AdminRoleDAO.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/f397ef2e/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java b/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java
index 78a7b46..b9b97d8 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleDAO.java
@@ -427,8 +427,10 @@ final class AdminRoleDAO extends ApacheDsDataProvider
         {
             ld = getAdminConnection();
             Entry findEntry = read( ld, dn, ROLE_ATRS );
-            entity = unloadLdapEntry( findEntry, 0, adminRole.getContextId() );
-
+            if(findEntry != null)
+            {
+                entity = unloadLdapEntry( findEntry, 0, adminRole.getContextId() );
+            }
             if ( entity == null )
             {
                 String warning = "getRole name [" + adminRole.getName() + "] no entry found
dn [" + dn + "]";
@@ -680,7 +682,7 @@ final class AdminRoleDAO extends ApacheDsDataProvider
         entity.setOsP( getAttributeSet( le, ROLE_OSP ) );
         entity.setOsU( getAttributeSet( le, ROLE_OSU ) );
         unloadTemporal( le, entity );
-        entity.setName( getAttribute( le, ROLE_NM ) );
+        entity.setName( getAttribute( le, SchemaConstants.CN_AT ) );
         entity.setRoleRangeRaw( getAttribute( le, ROLE_RANGE ) );
         //entity.setParents(AdminRoleUtil.getParents(entity.getName().toUpperCase(), contextId));
         entity.setParents( getAttributeSet( le, GlobalIds.PARENT_NODES ) );


Mime
View raw message