From cfd020082f6fb7015561b9a72b187ec59342dc12 Mon Sep 17 00:00:00 2001 From: Jj! Date: Thu, 28 Feb 2019 08:55:53 -0600 Subject: [PATCH] [#12] null check --- .../admin/ui/controller/support/RestControllersSupport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/support/RestControllersSupport.java b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/support/RestControllersSupport.java index f3fc8d2d7..f4bc81df4 100644 --- a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/support/RestControllersSupport.java +++ b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/support/RestControllersSupport.java @@ -48,7 +48,7 @@ public ResponseEntity handleDatabaseConstraintViolation(Constrain @ExceptionHandler(Exception.class) public final ResponseEntity 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); }