Skip to content

Commit

Permalink
Fix DeepScan: Expression 'parseInt(maxPageElem.attr('id'))' always pa…
Browse files Browse the repository at this point in the history
…sses null check. Consider using 'isNaN()' instead if invalid number checking was intended.
  • Loading branch information
rachasakr committed Jan 16, 2024
1 parent 68627a8 commit a76358e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/v2/parliament/section77.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ module.exports = async (ctx) => {
const maxPageElem = $('#pagination-more_new a[id]:last-child');

if (maxPageElem.length) {
pageCnt = parseInt(maxPageElem.attr('id')) ?? 1;
pageCnt = parseInt(maxPageElem.attr('id') ?? '1') ?? 1;
if (isNaN(pageCnt)) {
pageCnt = 1;
}
}

const actList = await Promise.all(
Expand Down

0 comments on commit a76358e

Please sign in to comment.