Skip to content

Commit

Permalink
bugfix: invalid token results in 500 instead of auth error
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenolen committed Mar 1, 2016
1 parent 71d3c90 commit e320cb2
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,15 @@ public void respond(HttpServletRequest httpRequest, HttpServletResponse httpResp

JSONObject jsonResult = new JSONObject();

for(AccessRequest request : results) {
try {
jsonResult.put(request.getRequestId(), request.toJsonObject());
}
catch(JSONException e) {
LOGGER.error("Error building the result JSONObject.", e);
setFailed();
if (results != null){
for(AccessRequest request : results) {
try {
jsonResult.put(request.getRequestId(), request.toJsonObject());
}
catch(JSONException e) {
LOGGER.error("Error building the result JSONObject.", e);
setFailed();
}
}
}

Expand Down

0 comments on commit e320cb2

Please sign in to comment.