Skip to content

Commit de24ff9

Browse files
committed
Fixed NaN values in datautils.getCounts
1 parent cb5a083 commit de24ff9

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) => Number.isNaN(data)? 0 : data;
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)