From 67d3877ff62cbafa117390dc4cf13d941ebc6567 Mon Sep 17 00:00:00 2001 From: rrachasak Date: Tue, 16 Jan 2024 16:36:33 +0700 Subject: [PATCH] Change NaN handling to satisfy DeepScan --- lib/v2/parliament/section77.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/v2/parliament/section77.js b/lib/v2/parliament/section77.js index ab45fa31c9f691..39b6f89d141dd3 100644 --- a/lib/v2/parliament/section77.js +++ b/lib/v2/parliament/section77.js @@ -68,10 +68,7 @@ module.exports = async (ctx) => { const maxPageElem = $('#pagination-more_new a[id]:last-child'); if (maxPageElem.length) { - pageCnt = parseInt(maxPageElem.attr('id') ?? '1') ?? 1; - if (isNaN(pageCnt)) { - pageCnt = 1; - } + pageCnt = parseInt(maxPageElem.attr('id') ?? '1') || 1; } const actList = await Promise.all(