Skip to content

AWS Lambda: Undefined/null array result + captureAllSettledReasons: true = sentry crash #19344

@Jimmy89

Description

@Jimmy89

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/aws-serverless

SDK Version

10.39.0

Framework Version

NodeJS 24 on AWS Lambda

Link to Sentry event

https://basisbeeld.sentry.io/issues/20900435/

Reproduction Example/SDK Setup

We have a main instrument.mjs loading the dsn.

The code below should be enough to trigger the error (on AWS Lambda):

const handlerFn = async () => {
  return [null];
}

const sentryOptions = { captureAllSettledReasons: true };
export const handler = Sentry.wrapHandler(() => handlerFn(), sentryOptions);

Steps to Reproduce

With captureAllSettledReasons set to true return an empty with anything that will fail the Object.prototype.hasOwnProperty.call(v, 'status') check (undefined/null).

Expected Result

That sentry does not crash our app ;)

Actual Result

Cannot convert undefined or null to object

Additional Context

This line triggers the check, which is good.

In this function an additional check should be made if v is actually an object, before doing object checks.

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions