Skip to content

Commit

Permalink
Fix null pointer exception when displaying error
Browse files Browse the repository at this point in the history
  • Loading branch information
Portals committed Jul 30, 2024
1 parent eaca2ef commit 3794075
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ public ModelAndView handleRuntimeException(
HttpServletResponse response,
HttpServletRequest request) {
Object statusCodeString = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
int statusCode = Integer.parseInt(statusCodeString.toString());

System.out.println(statusCode);
int statusCode = statusCodeString == null ? 500 : Integer.parseInt(statusCodeString.toString());

String page =
switch (HttpStatus.valueOf(statusCode)) {
Expand Down

0 comments on commit 3794075

Please sign in to comment.