Skip to content

Commit

Permalink
Avoid NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
k-tamura committed Dec 23, 2019
1 parent ef48899 commit beec2ec
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,11 @@ private void changeNextPageToUserInfo(ModelAndView mav, Locale locale, Map<?, ?>
Map<?, ?> fromJson = new Gson().fromJson(e.getContent(), Map.class);
if (e.getStatusCode() == 401 && fromJson != null && "invalid_token".equals(fromJson.get("error"))) {
TokenResponse tokenRes = refreshTokens((String) ses.getAttribute("refreshToken"));
ses.setAttribute("accessToken", tokenRes.getAccessToken());
ses.setAttribute("refreshToken", tokenRes.getRefreshToken());
return getUserInfo(ses);
if (tokenRes != null) {
ses.setAttribute("accessToken", tokenRes.getAccessToken());
ses.setAttribute("refreshToken", tokenRes.getRefreshToken());
return getUserInfo(ses);
}
} else {
log.error("Userinfo request failed.", e);
}
Expand Down

0 comments on commit beec2ec

Please sign in to comment.