From ef9a51aec75be7313118e225194f4856bf3885da Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Wed, 19 Jan 2022 19:43:31 +0300 Subject: [PATCH] to don't duplicate hardcoded strings --- media/com_jedchecker/js/script.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/media/com_jedchecker/js/script.js b/media/com_jedchecker/js/script.js index 930a75a..634cb45 100644 --- a/media/com_jedchecker/js/script.js +++ b/media/com_jedchecker/js/script.js @@ -4,12 +4,11 @@ let jedOptions; try { jedOptions = JSON.parse(document.getElementById('jed-rules-json').innerHTML); + if (!jedOptions) throw new Error(); } catch (e) { throw new Error('Initialization data is missing'); } - if (!jedOptions) throw new Error('Initialization data is missing'); - const add_validation = () => { // Loop over them and prevent submission [...document.querySelectorAll('.needs-validation')].forEach((form) => {