Skip to content

Commit

Permalink
Null banner JSON message fix (#10640)
Browse files Browse the repository at this point in the history
* Null banner JSON message fix

* message change
  • Loading branch information
jp-tosca authored Jun 20, 2024
1 parent adf1167 commit c141941
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2337,6 +2337,7 @@ public Response addBannerMessage(JsonObject jsonObject) throws WrappedResponse {

BannerMessage toAdd = new BannerMessage();
try {

String dismissible = jsonObject.getString("dismissibleByUser");

boolean dismissibleByUser = false;
Expand Down Expand Up @@ -2367,7 +2368,7 @@ public Response addBannerMessage(JsonObject jsonObject) throws WrappedResponse {

} catch (Exception e) {
logger.warning("Unexpected Exception: " + e.getMessage());
return error(Status.BAD_REQUEST, "Add Banner Message unexpected exception: " + e.getMessage());
return error(Status.BAD_REQUEST, "Add Banner Message unexpected exception: invalid or missing JSON object.");
}

}
Expand Down

0 comments on commit c141941

Please sign in to comment.