Skip to content

Commit

Permalink
Improve logic of null case
Browse files Browse the repository at this point in the history
  • Loading branch information
k-tamura committed May 28, 2017
1 parent 427d401 commit 7d89337
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr
session.setAttribute("userid", userid);

String gotoUrl = request.getParameter("goto");
try {
URL u = new URL(gotoUrl);
gotoUrl = u.toURI().toString();
} catch (Exception e) {
log.warn("Invalid goto Url: {}", gotoUrl);
}
if (gotoUrl != null) {
try {
URL u = new URL(gotoUrl);
gotoUrl = u.toURI().toString();
} catch (Exception e) {
log.warn("Invalid goto Url: {}", gotoUrl);
}
response.sendRedirect(gotoUrl);
} else {
String target = (String) session.getAttribute("target");
Expand Down

0 comments on commit 7d89337

Please sign in to comment.