From daece3018b33d4c6311cfde77ced40c4c42effa6 Mon Sep 17 00:00:00 2001 From: Detlev Casanova Date: Wed, 9 Aug 2023 10:44:39 -0400 Subject: [PATCH] Avoid split on undefined --- dist/index.js | 4 ++-- src/utils/parse-utils.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 78b2f56..f95b296 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2195,8 +2195,8 @@ function parseIsoDate(str) { } exports.parseIsoDate = parseIsoDate; function getFirstNonEmptyLine(stackTrace) { - const lines = stackTrace.split(/\r?\n/g); - return lines.find(str => !/^\s*$/.test(str)); + const lines = stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.split(/\r?\n/g); + return lines === null || lines === void 0 ? void 0 : lines.find(str => !/^\s*$/.test(str)); } exports.getFirstNonEmptyLine = getFirstNonEmptyLine; diff --git a/src/utils/parse-utils.ts b/src/utils/parse-utils.ts index 44bc389..a4f4885 100644 --- a/src/utils/parse-utils.ts +++ b/src/utils/parse-utils.ts @@ -19,6 +19,6 @@ export function parseIsoDate(str: string): Date { } export function getFirstNonEmptyLine(stackTrace: string): string | undefined { - const lines = stackTrace.split(/\r?\n/g) - return lines.find(str => !/^\s*$/.test(str)) + const lines = stackTrace?.split(/\r?\n/g) + return lines?.find(str => !/^\s*$/.test(str)) }