Avoid split on undefined

This commit is contained in:
Detlev Casanova 2023-08-09 10:44:39 -04:00
parent e9fa2f582c
commit daece3018b
2 changed files with 4 additions and 4 deletions

View file

@ -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))
}