Skip to content

Commit

Permalink
[#12]
Browse files Browse the repository at this point in the history
null check
  • Loading branch information
jj committed Feb 28, 2019
1 parent c0f64df commit cfd0200
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ResponseEntity<ErrorResponse> handleDatabaseConstraintViolation(Constrain

@ExceptionHandler(Exception.class)
public final ResponseEntity<ErrorResponse> handleAllOtherExceptions(Exception ex) {
ErrorResponse errorResponse = new ErrorResponse("400", ex.getLocalizedMessage(), ex.getCause().getLocalizedMessage());
ErrorResponse errorResponse = new ErrorResponse("400", ex.getLocalizedMessage(), ex.getCause() == null ? null : ex.getCause().getLocalizedMessage());
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
}

Expand Down

0 comments on commit cfd0200

Please sign in to comment.