From 860209a5f9c2c01544de1fc9c22d2439405a78cf Mon Sep 17 00:00:00 2001 From: Joe Uhren Date: Sat, 3 Feb 2024 08:56:40 -0700 Subject: [PATCH] Fix an issue with invalid masternode count -This fix prevents an error from being thrown that crashes the explorer when trying to use a masternode count that is a sinlge number. A single number masternode count is not valid or usable since it cannot differentiate the number of good and bad nodes, but the explorer will no longer crash when given this data --- lib/explorer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/explorer.js b/lib/explorer.js index 4ce60680..d3e9d383 100644 --- a/lib/explorer.js +++ b/lib/explorer.js @@ -154,7 +154,7 @@ function normalizeMasternodeCount(raw_count) { total: splitCount[1].trim() }; // check if the data is in the format of "Total: {total_count} Enabled: {enabled_count}" - } else if (raw_count.indexOf('Total: ') > -1 && raw_count.indexOf('Enabled: ')) { + } else if (raw_count.toString().indexOf('Total: ') > -1 && raw_count.toString().indexOf('Enabled: ')) { // Total: {total_count} Enabled: {enabled_count}" format detected const totalRegex = /Total: (\d+)/; const enabledRegex = /Enabled: (\d+)/;