File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -411,7 +411,10 @@ def is_legacy_lambda_step_function(event):
411411 """
412412 Check if the event is a step function that called a legacy lambda
413413 """
414- event = event .get ("Payload" , {})
414+ if not isinstance (event , dict ) or "Payload" not in event :
415+ return False
416+
417+ event = event .get ("Payload" )
415418 return "Execution" in event and "StateMachine" in event and "State" in event
416419
417420
Original file line number Diff line number Diff line change @@ -678,6 +678,9 @@ def test_is_legacy_lambda_step_function(self):
678678 }
679679 self .assertFalse (is_legacy_lambda_step_function (sf_event ))
680680
681+ other_event = ["foo" , "bar" ]
682+ self .assertFalse (is_legacy_lambda_step_function (other_event ))
683+
681684
682685class TestXRayContextConversion (unittest .TestCase ):
683686 def test_convert_xray_trace_id (self ):
You can’t perform that action at this time.
0 commit comments