From 010a27186ec8cb329509e729253f0de7b7e1c769 Mon Sep 17 00:00:00 2001 From: Erika Miguel Date: Mon, 22 Apr 2024 13:02:41 -0400 Subject: [PATCH] Handle case where original error is undefined --- lib/reporters/tap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/reporters/tap.js b/lib/reporters/tap.js index 258c927fc..278d7e62b 100644 --- a/lib/reporters/tap.js +++ b/lib/reporters/tap.js @@ -24,7 +24,9 @@ function dumpError({ }; } - originalError.name = name; // Restore the original name. + if (originalError) { + originalError.name = name; // Restore the original name. + } if (type === 'ava') { if (assertion) {