Skip to content

Commit

Permalink
Null check
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis authored Oct 13, 2022
1 parent 8834d17 commit 8cb8c9b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ private ExtensionRestResponse handlePostRequest(ExtensionRestRequest request) {
} else {
return new ExtensionRestResponse(request, NOT_ACCEPTABLE, "Only text and JSON content types are supported");
}
if (!adjective.isBlank()) {
worldAdjectives.add(adjective);
if (adjective != null && !adjective.isBlank()) {
worldAdjectives.add(adjective.trim());
return new ExtensionRestResponse(request, OK, "Added " + adjective + " to words that describe the world!");
}
return new ExtensionRestResponse(request, BAD_REQUEST, "No adjective included with POST request");
Expand Down

0 comments on commit 8cb8c9b

Please sign in to comment.