Handle nil response from Lambda when invocation_type = "Event" #732
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a 🐞 bug fix.
bundle exec rspec
to verify this)Summary
In v5.0.X, when Lambda function is invoked with
invocation_type = "Event"
, the response from Lambda will only include status code and the payload becomes null.This will cause
NoMethodError (undefined method read for nil:NilClass)
.Therefore, I added handling for nil value.
jets/lib/jets/commands/call/caller.rb
Line 66 in e682c5d
jets/lib/jets/commands/call/caller.rb
Line 78 in e682c5d
Context
No specific context.
How to Test
Call Lambda functions with
invocation_type = "Event"
option in v5.0.XVersion Changes
v5.0.15 (Please merge to v5 branch, instead of latest master branch 🙏 )