From dfae2d231e39c81827d08fd8834d736c5b3005b1 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Tue, 31 Aug 2021 16:25:57 +0530 Subject: refactor: Use Ferdi.safeParseInt to ensure that parsing is done consistently in all recipes. --- recipes/wechat/webview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'recipes/wechat/webview.js') diff --git a/recipes/wechat/webview.js b/recipes/wechat/webview.js index 874ab55..b1d8e31 100644 --- a/recipes/wechat/webview.js +++ b/recipes/wechat/webview.js @@ -13,8 +13,8 @@ module.exports = (Ferdi) => { const reddot = item.querySelector('i.web_wechat_reddot_middle'); const avatarImage = item.querySelector('img.img'); - if (reddot && reddot.innerText) { - count = parseInt(reddot.innerText); + if (reddot) { + count = Ferdi.safeParseInt(reddot.innerText); } if (avatarImage && avatarImage.getAttribute('src').search('webwxgeticon') != -1) { -- cgit v1.2.3-70-g09d2