Skip to content

Commit

Permalink
also guard against no filename in first frame
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Aug 30, 2024
1 parent 1e054bc commit 12c0d06
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions peachjam/js/peachjam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,15 @@ class PeachJam {

// if first frame is anonymous, don't send this event
// see https://github.com/getsentry/sentry-javascript/issues/3147
if (frames && frames.length > 0 && frames[0].filename === '<anonymous>') {
return null;
if (frames && frames.length > 0) {
const firstFrame = frames[0];
if (!firstFrame.filename || firstFrame.filename === '<anonymous>') {
return null;
}
}
} catch (e) {
// ignore error, send event
console.log(e);
}

return event;
Expand Down

0 comments on commit 12c0d06

Please sign in to comment.