Skip to content

Commit

Permalink
Merge pull request #258 from cazou/fix-split-on-undefined
Browse files Browse the repository at this point in the history
Avoid split on undefined
  • Loading branch information
j-catania committed Oct 9, 2023
2 parents 4eb4bc2 + daece30 commit f3a6ff2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/utils/parse-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

0 comments on commit f3a6ff2

Please sign in to comment.