Skip to content

Commit 8e9dda3

Browse files
authored
Added additional check before adding the ._error property (#1657)
* Update error.js * fix: error.js formatting Co-authored-by: Alex Sokolov <[email protected]>
1 parent fadddc2 commit 8e9dda3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: packages/test-utils/src/error.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ function errorHandler(errorOrString, vm) {
55
const error =
66
typeof errorOrString === 'object' ? errorOrString : new Error(errorOrString)
77

8-
vm._error = error
8+
if (vm) {
9+
vm._error = error
10+
}
11+
912
throw error
1013
}
1114

0 commit comments

Comments
 (0)