added null check to confirmation controller, closes #684

pull/695/head
Justin Richer 2014-10-07 21:58:00 -04:00
parent e814c3abd4
commit 188818dc0d
1 changed files with 14 additions and 12 deletions

View File

@ -153,8 +153,9 @@ public class OAuthConfirmationController {
// get the userinfo claims for each scope
UserInfo user = userInfoService.getByUsername(p.getName());
JsonObject userJson = user.toJson();
Map<String, Map<String, String>> claimsForScopes = new HashMap<String, Map<String, String>>();
if (user != null) {
JsonObject userJson = user.toJson();
for (SystemScope systemScope : sortedScopes) {
Map<String, String> claimValues = new HashMap<String, String>();
@ -169,6 +170,7 @@ public class OAuthConfirmationController {
claimsForScopes.put(systemScope.getValue(), claimValues);
}
}
model.put("claims", claimsForScopes);