Skip to content

Commit

Permalink
Fix NPE if handler returns explicit null response
Browse files Browse the repository at this point in the history
  • Loading branch information
breedloj authored Sep 7, 2018
1 parent 9724ba5 commit c70b0dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ask-sdk-core/src/com/amazon/ask/Skill.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public ResponseEnvelope invoke(RequestEnvelope requestEnvelope, Object context)

Optional<Response> response = requestDispatcher.dispatch(handlerInput);
return ResponseEnvelope.builder()
.withResponse(response.orElse(null))
.withResponse(response != null ? response.orElse(null) : null)
.withSessionAttributes
(requestEnvelope.getSession() != null ? handlerInput.getAttributesManager().getSessionAttributes() : null)
.withVersion(SdkConstants.FORMAT_VERSION)
Expand Down

0 comments on commit c70b0dd

Please sign in to comment.