Skip to content

Commit

Permalink
fix(awslambda): aws_event can be an empty list (#2849)
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana authored Mar 19, 2024
1 parent 8e44430 commit 856e5bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def sentry_handler(aws_event, aws_context, *args, **kwargs):
# will be the same for all events in the list, since they're all hitting
# the lambda in the same request.)

if isinstance(aws_event, list):
if isinstance(aws_event, list) and len(aws_event) >= 1:
request_data = aws_event[0]
batch_size = len(aws_event)
else:
Expand Down
1 change: 1 addition & 0 deletions tests/integrations/aws_lambda/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ def test_handler(event, context):
True,
2,
),
(b"[]", False, 1),
],
)
def test_non_dict_event(
Expand Down

0 comments on commit 856e5bc

Please sign in to comment.