Skip to content

Commit 0ef5dbc

Browse files
authored
Merge pull request #82 from networknt/issue81
fixes #81 Resolve an NPE issue in SanitizerMiddleware
2 parents 9b8ad8f + cf75e02 commit 0ef5dbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/networknt/aws/lambda/handler/middleware/sanitizer/SanitizerMiddleware.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public Status execute(LightLambdaExchange exchange) {
6969

7070
if (CONFIG.isBodyEnabled() && ("POST".equalsIgnoreCase(method) || "PUT".equalsIgnoreCase(method) || "PATCH".equalsIgnoreCase(method))) {
7171
String body = exchange.getRequest().getBody();
72-
if (!body.isEmpty()) {
72+
if (body != null && !body.isEmpty()) {
7373
body = body.trim();
7474
if (body.startsWith("{")) {
7575
Map<String, Object> bodyMap = JsonMapper.string2Map(body);

0 commit comments

Comments
 (0)