From 76846dbdf7bc7babd60314aea3d561a52de6288f Mon Sep 17 00:00:00 2001 From: Kenny Joseph Date: Mon, 1 Apr 2024 15:32:14 -0400 Subject: [PATCH] fix null/NaN block limit --- packages/bitcore-node/src/routes/api/block.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bitcore-node/src/routes/api/block.ts b/packages/bitcore-node/src/routes/api/block.ts index 13416d1798c..2836e4449f6 100644 --- a/packages/bitcore-node/src/routes/api/block.ts +++ b/packages/bitcore-node/src/routes/api/block.ts @@ -10,7 +10,7 @@ router.get('/', async function(req: Request, res: Response) { let { chain, network } = req.params; let { sinceBlock, date, limit, since, direction, paging } = req.query as any; if (limit) { - limit = parseInt(limit); + limit = parseInt(limit) || undefined; // if limit is NaN or null, set it to undefined so it'll fallback to CSP default } try { let payload = {