Skip to content

Commit

Permalink
Merge pull request #5134 from Countly/Cookiezaurs-patch-5
Browse files Browse the repository at this point in the history
Nullcheck in data exports
  • Loading branch information
Cookiezaurs authored Apr 29, 2024
2 parents ccf4755 + 3406693 commit 353b3f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/parts/data/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function transformValuesInObject(doc, mapper) {
for (var z in doc) {
doc[z] = transformValue(doc[z], z, mapper, docOrig);
}
if (mapper.calculated_fields) {
if (mapper && mapper.calculated_fields) {
for (var n = 0; n < mapper.calculated_fields.length; n++) {
doc[mapper.calculated_fields[n]] = transformValue(0, mapper.calculated_fields[n], mapper, docOrig);
}
Expand Down Expand Up @@ -730,4 +730,4 @@ exports.fromData = function(data, options) {
}
};

module.exports = exports;
module.exports = exports;

0 comments on commit 353b3f7

Please sign in to comment.