Commit af42ba45 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Fix for IndexOutOfBoundsException (JM-553).

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3384 b35dd754-fafc-0310-a699-88a17e54d16e
parent 11e7ac06
...@@ -229,7 +229,8 @@ public class LdapUserProvider implements UserProvider { ...@@ -229,7 +229,8 @@ public class LdapUserProvider implements UserProvider {
usernames.add(JID.escapeNode(username)); usernames.add(JID.escapeNode(username));
} }
Collections.sort(usernames); Collections.sort(usernames);
usernames = usernames.subList(startIndex, startIndex+numResults); int endIndex = Math.min(startIndex + numResults, usernames.size()-1);
usernames = usernames.subList(startIndex, endIndex);
} }
// Otherwise, only read in certain results. // Otherwise, only read in certain results.
else { else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment