Skip to content

Unhandled exception handler can potentially crash #9579

@rchl

Description

@rchl

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/vue

SDK Version

7.80.0

Framework Version

Vue 2

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

I am the maintainer of @nuxtjs/sentry and I have this code in the module:

https://github.com/nuxt-community/sentry-module/blob/e728a349e212cb422a385ee8619cf00353b318fd/src/templates/plugin.lazy.js#L21-L21

It duplicates the code that Sentry SDK has in:

p: 'reason' in e ? e.reason : 'detail' in e && 'reason' in e.detail ? e.detail.reason : e

Recently I've noticed that my code causes crashes like e.detail is not an Object. (evaluating '"reason"in e.detail') so then I would assume that Sentry's SDK can also crash in the same way. So while I will fix it on my side, the SDK should also do so.

The 'reason' in e ? e.reason : 'detail' in e && 'reason' in e.detail ? e.detail.reason : e can crash because 'reason' in e.detail will crash if e.detail is undefined and there is no truthiness check done against it first.

Expected Result

no crash

Actual Result

crash

Metadata

Metadata

Assignees

Labels

Package: vueIssues related to the Sentry Vue SDK

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions