Skip to content

Commit

Permalink
Avoid split on undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Detlev Casanova committed Aug 9, 2023
1 parent e9fa2f5 commit daece30
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 daece30

Please sign in to comment.