Skip to content

Commit

Permalink
SAK-26151 FileUserDirectoryProvider should pass failed searches back.
Browse files Browse the repository at this point in the history
When a problem occurs with one of the providers in the FilterUserDirectoryProvider it should pass that error back up to the caller. Before this it was causing a stack trace with a NPE

git-svn-id: https://source.sakaiproject.org/svn/providers/trunk@308665 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
buckett committed Apr 25, 2014
1 parent 7b2052b commit a6a2ad7
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,13 @@ public List<UserEdit> searchExternalUsers(String criteria, int first, int last,
m_logger.debug("searchExternalUsers() criteria=" + criteria);
}

users.addAll(extSearchUDP.searchExternalUsers(criteria, first, last, factory));
List<UserEdit> searchExternalUsers = extSearchUDP.searchExternalUsers(criteria, first, last, factory);
if (searchExternalUsers != null) {
users.addAll(searchExternalUsers);
} else {
// When something goes wrong with the search we want to pass this back up the stack.
return null;
}
}

if ( nextProvider instanceof ExternalUserSearchUDP) {
Expand All @@ -584,7 +590,13 @@ public List<UserEdit> searchExternalUsers(String criteria, int first, int last,
m_logger.debug("nextProvider searchExternalUsers() criteria=" + criteria);
}

users.addAll(extSearchUDP.searchExternalUsers(criteria, first, last, factory));
List<UserEdit> searchExternalUsers = extSearchUDP.searchExternalUsers(criteria, first, last, factory);
if (searchExternalUsers != null) {
users.addAll(searchExternalUsers);
} else {
// When something goes wrong with the search we want to pass this back up the stack.
return null;
}
}

return users;
Expand Down

0 comments on commit a6a2ad7

Please sign in to comment.