diff --git a/lib/common-utils.ts b/lib/common-utils.ts index aff185615..5f9401302 100644 --- a/lib/common-utils.ts +++ b/lib/common-utils.ts @@ -331,7 +331,7 @@ const cloneError = (error: T): T => { }; export const mergeSnippetIntoErrorStack = (error: T & { snippet?: string }): T => { - if (!error.snippet) { + if (!error || !error.snippet) { return error; }