From f52edce8fc380167af6489ae0c7ca42f77232ba8 Mon Sep 17 00:00:00 2001 From: Quentin Decaunes Date: Sun, 4 Aug 2019 10:07:49 +0200 Subject: [PATCH] fix(developers): Sentry unable to retrieve stacktrace frames in some cases. --- js/app.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/js/app.js b/js/app.js index 083be6b..b40ad36 100644 --- a/js/app.js +++ b/js/app.js @@ -8,13 +8,17 @@ ready(function(){ release: require('./package.json').version, beforeSend: (event) => { event.exception.values = event.exception.values.map((value) => { - value.stacktrace.frames = value.stacktrace.frames.map((frame) => { - frame.filename = frame.filename.replace(/^.*ryzen(|-)controller\//g, ""); - return frame; - }) + if (value.stacktrace) { + value.stacktrace.frames = value.stacktrace.frames.map((frame) => { + frame.filename = frame.filename.replace(/^.*ryzen(|-)controller\//g, ""); + return frame; + }); + } return value; }); - event.request.url = event.request.url.replace(/^.*ryzen(|-)controller\//g, "") + if (event.request.url) { + event.request.url = event.request.url.replace(/^.*ryzen(|-)controller\//g, ""); + } return event; } });