File tree 2 files changed +7
-1
lines changed
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):
411
411
"""
412
412
Check if the event is a step function that called a legacy lambda
413
413
"""
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" )
415
418
return "Execution" in event and "StateMachine" in event and "State" in event
416
419
417
420
Original file line number Diff line number Diff line change @@ -678,6 +678,9 @@ def test_is_legacy_lambda_step_function(self):
678
678
}
679
679
self .assertFalse (is_legacy_lambda_step_function (sf_event ))
680
680
681
+ other_event = ["foo" , "bar" ]
682
+ self .assertFalse (is_legacy_lambda_step_function (other_event ))
683
+
681
684
682
685
class TestXRayContextConversion (unittest .TestCase ):
683
686
def test_convert_xray_trace_id (self ):
You can’t perform that action at this time.
0 commit comments