diff options
author | Vijay A <avijayr@protonmail.com> | 2021-08-31 16:25:57 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-08-31 16:25:57 +0530 |
commit | dfae2d231e39c81827d08fd8834d736c5b3005b1 (patch) | |
tree | 5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/discord/webview.js | |
parent | New recipe: odoo (diff) | |
download | ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.tar.gz ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.tar.zst ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.zip |
refactor: Use Ferdi.safeParseInt to ensure that parsing is done consistently in all recipes.
Diffstat (limited to 'recipes/discord/webview.js')
-rw-r--r-- | recipes/discord/webview.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/recipes/discord/webview.js b/recipes/discord/webview.js index 88a5c50..0559612 100644 --- a/recipes/discord/webview.js +++ b/recipes/discord/webview.js | |||
@@ -75,7 +75,9 @@ module.exports = (Ferdi, settings) => { | |||
75 | 75 | ||
76 | if (elementContainer) { | 76 | if (elementContainer) { |
77 | const element = elementContainer.querySelector('[data-text-as-pseudo-element]'); | 77 | const element = elementContainer.querySelector('[data-text-as-pseudo-element]'); |
78 | count = parseInt(element.dataset.textAsPseudoElement, 10); | 78 | if (element && element.dataset) { |
79 | count = Ferdi.safeParseInt(element.dataset.textAsPseudoElement); | ||
80 | } | ||
79 | } | 81 | } |
80 | } | 82 | } |
81 | } | 83 | } |