From 0bda367f103fa432c94b31dffd164d24c9f6a54b Mon Sep 17 00:00:00 2001 From: ign_guus Date: Mon, 17 May 2021 08:29:49 +0100 Subject: [PATCH] * Check that `options` is defined before accessing its attributes. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index c3252b2..cfae715 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,7 @@ export default { const validator = new Validator(); // Apply options - if (typeof options.errorMessages === 'object') { + if (options && typeof options.errorMessages === 'object') { validator.setErrorMessages(options.errorMessages); }