Skip to content

Commit 06a3f35

Browse files
committed
Filter modified to prevent mongo error
The filter on the health data array now checks for null values. This resulted in an error since we were inputting multiple nulls into the same db.
1 parent 6328d2f commit 06a3f35

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

chronos_npm_package/controllers/healthHelpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ healthHelpers.collectHealthData = async() => {
220220
return Promise.all(healthDataCollection).then(array => {
221221
// console.log("PROMISE ARRAY",array)
222222
return array.filter(metric => {
223-
if (isNaN(metric.value) || metric.value === 'NaN' || metric.value === '') return false;
223+
if (isNaN(metric.value) || metric.value === 'NaN' || metric.value === '' || metric.value === null) return false;
224224
else return true;
225225
})
226226
}

0 commit comments

Comments
 (0)