From a0231a7fc357cbb4b41de932a9b7994304119d0b Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 20 Jul 2020 22:15:38 +0200 Subject: [PATCH] No longer expect a ValidationError to be an Error instance --- src/compose-rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compose-rules.js b/src/compose-rules.js index 486dd61..a5ab344 100644 --- a/src/compose-rules.js +++ b/src/compose-rules.js @@ -40,7 +40,7 @@ module.exports.compose = function composeValidators(validators) { } else { throw new Error(`The 'errors' in a validationResult must be an array`); } - } else if (result instanceof Error && matchValidationError(result)) { + } else if (result != null && matchValidationError(result)) { return { errors: [ result ], newValue: undefined