Skip to content

Commit d6ff05f

Browse files
committed
fix: do not fail when extend error with snippet
1 parent 0bbf550 commit d6ff05f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/common-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ const cloneError = <T extends Error>(error: T): T => {
331331
};
332332

333333
export const mergeSnippetIntoErrorStack = <T extends Error>(error: T & { snippet?: string }): T => {
334-
if (!error.snippet) {
334+
if (!error || !error.snippet) {
335335
return error;
336336
}
337337

0 commit comments

Comments
 (0)