Skip to content

Commit dea8811

Browse files
authored
Merge pull request #182 from nikhilhassija/stats-fix-2
Fixed NaN values in datautils.getCounts
2 parents f1c77d4 + 90559eb commit dea8811

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

utils/datautils.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ function getCounts() {
121121
'bounty',
122122
'sum'
123123
);
124-
if (Number.isNaN(accepted)) {
125-
accepted = 0;
126-
}
127-
if (Number.isNaN(totalclaimed)) {
128-
totalclaimed = 0;
129-
}
130-
return Promise.all([participants, claims, accepted, totalclaimed]);
124+
125+
var filterNaN = (data) => data || 0;
126+
127+
var counts = Promise.all([participants, claims, accepted, totalclaimed])
128+
.then((values) => values.map(filterNaN));
129+
130+
return counts;
131131
}
132132

133133
module.exports = {

0 commit comments

Comments
 (0)