1 parent e98d951 commit 3eb3590Copy full SHA for 3eb3590
2 files changed
datadog_lambda/trigger.py
@@ -461,6 +461,8 @@ def is_step_function_event(event):
461
The actual event must contain "Execution", "StateMachine", and "State" fields.
462
"""
463
event = event.get("Payload", event)
464
+ if not isinstance(event, dict):
465
+ return False
466
467
# JSONPath style
468
if "Execution" in event and "StateMachine" in event and "State" in event:
tests/test_trigger.py
@@ -757,3 +757,7 @@ def test_is_step_function_event_dd_header(self):
757
}
758
759
self.assertFalse(is_step_function_event(event))
760
+
761
+ def test_is_step_function_event_payload_not_dict(self):
762
+ event = {"Payload": "This is a string, not a dict"}
763
+ self.assertFalse(is_step_function_event(event))
0 commit comments