From 69004bbe0b7fc811ebe79be474f34aeea99b5956 Mon Sep 17 00:00:00 2001 From: Egorov Vlad Date: Fri, 18 Nov 2022 16:12:45 +0200 Subject: [PATCH] BUGFIX: Crashing when custom validator func passed --- dist/validator.js | 2 +- src/validator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/validator.js b/dist/validator.js index 250d12ca..ddbc0b2e 100644 --- a/dist/validator.js +++ b/dist/validator.js @@ -1814,7 +1814,7 @@ Validator.prototype = { if(Array.isArray(path2)){ path2 = path2[0]; } - const pos = path2.indexOf('*'); + const pos = path2.indexOf !== undefined ? path2.indexOf('*') : -1; if (pos === -1) { return path2; } diff --git a/src/validator.js b/src/validator.js index ce5ba328..07fb397f 100755 --- a/src/validator.js +++ b/src/validator.js @@ -296,7 +296,7 @@ Validator.prototype = { if(Array.isArray(path2)){ path2 = path2[0]; } - const pos = path2.indexOf('*'); + const pos = path2.indexOf !== undefined ? path2.indexOf('*') : -1; if (pos === -1) { return path2; }