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-191 - remove possible npe
Date Sun, 09 Oct 2016 16:15:15 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 7322d550d -> 748b2cf6f


FC-191 - remove possible npe


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/748b2cf6
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/748b2cf6
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/748b2cf6

Branch: refs/heads/master
Commit: 748b2cf6f2d4af762a39d820cbffb980a145634e
Parents: 7322d55
Author: Shawn McKinney <smckinney@apache.org>
Authored: Sun Oct 9 11:15:09 2016 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Sun Oct 9 11:15:09 2016 -0500

----------------------------------------------------------------------
 .../directory/fortress/core/impl/RoleDAO.java   | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/748b2cf6/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
index a79dc03..c2aa631 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
@@ -507,15 +507,21 @@ final class RoleDAO extends LdapDataProvider
                     filterbuf.append( ")" );
                 }
                 filterbuf.append( "))" );
-            }
-            ld = getAdminConnection();
-            SearchCursor searchResults = search( ld, roleRoot,
-                SearchScope.ONELEVEL, filterbuf.toString(), ROLE_ATRS, false, GlobalIds.BATCH_SIZE
);
-            long sequence = 0;
 
-            while ( searchResults.next() )
+                ld = getAdminConnection();
+                SearchCursor searchResults = search( ld, roleRoot,
+                    SearchScope.ONELEVEL, filterbuf.toString(), ROLE_ATRS, false, GlobalIds.BATCH_SIZE
);
+                long sequence = 0;
+
+                while ( searchResults.next() )
+                {
+                    roleList.add( unloadLdapEntry( searchResults.getEntry(), sequence++,
group.getContextId() ) );
+                }
+            }
+            else
             {
-                roleList.add( unloadLdapEntry( searchResults.getEntry(), sequence++, group.getContextId()
) );
+                String error = "groupRoles passed empty member list";
+                throw new FinderException( GlobalErrIds.GROUP_MEMBER_NULL, error );
             }
         }
         catch ( LdapException e )


Mime
View raw message