From defc1675036fa917bbb1396eb2351b280afb0a7a Mon Sep 17 00:00:00 2001 From: David Tinoco Date: Wed, 6 Jul 2022 15:15:03 -0400 Subject: [PATCH] Update placeholder.js Catches the error of not defining the attributes in the default placeholders methods. --- src/placeholders.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/placeholders.js b/src/placeholders.js index 5fd886b..8232be7 100644 --- a/src/placeholders.js +++ b/src/placeholders.js @@ -123,5 +123,11 @@ function getDefaultPlaceholderValue(placeholder, fieldData) { } const placeholderFunc = rulePlaceholders[placeholder]; - return placeholderFunc && placeholderFunc(fieldData); -} \ No newline at end of file + try{ + return placeholderFunc && placeholderFunc(fieldData); + } + catch(err){ + console.warn(`Warning: the ${placeholder} property is not defined on ${fieldData.key}.`); + return null; + } +}