mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-01 10:55:23 -08:00
Avoid split on undefined
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user