GH-639 Fix NPE for when using Supplier with AWS API Gateway

This commit is contained in:
Oleg Zhurakousky
2021-02-08 10:38:22 +01:00
parent 3948f35271
commit 2f092c19cf

View File

@@ -182,7 +182,7 @@ public class FunctionInvoker implements RequestStreamHandler {
} }
else if (requestMap.containsKey("httpMethod")) { // API Gateway else if (requestMap.containsKey("httpMethod")) { // API Gateway
logger.info("Incoming request is API Gateway"); logger.info("Incoming request is API Gateway");
if (inputType.getTypeName().endsWith(APIGatewayProxyRequestEvent.class.getSimpleName())) { if (inputType != null && inputType.getTypeName().endsWith(APIGatewayProxyRequestEvent.class.getSimpleName())) {
APIGatewayProxyRequestEvent gatewayEvent = this.mapper.convertValue(requestMap, APIGatewayProxyRequestEvent.class); APIGatewayProxyRequestEvent gatewayEvent = this.mapper.convertValue(requestMap, APIGatewayProxyRequestEvent.class);
messageBuilder = MessageBuilder.withPayload(gatewayEvent); messageBuilder = MessageBuilder.withPayload(gatewayEvent);
} }