Skip to content

Commit c9b2a29

Browse files
authored
Merge pull request #129 from barakd/ensure-call-sites-return-array
ensure getCallSites return array
2 parents 7ba0f97 + 95a8c6e commit c9b2a29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CallSitesHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,5 @@ Object.defineProperty(Error, "prepareStackTrace", {
7878
});
7979

8080
export function getCallSites(err: Error): NodeJS.CallSite[] {
81-
return err.stack ? err[callsitesSym] : err[callsitesSym];
81+
return (err.stack ? err[callsitesSym] : err[callsitesSym]) || [];
8282
}

0 commit comments

Comments
 (0)