Skip to content

Commit b731241

Browse files
author
Joel Alejandro Villarreal Bertoldi
authored
Merge pull request #4 from joelalejandro/fix/issue-3
Adds null check to transform
2 parents dafcdc0 + feb4fad commit b731241

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
function csvToArray(value) {
4-
return value.split(',').map(function(item) { return item.trim(); });
4+
return value !== null ? value.split(',').map(function(item) { return item.trim(); }) : [];
55
}
66

77
function applyCsvToArrayTransform(data, model) {
@@ -30,4 +30,4 @@ module.exports = function (options = {}) { // eslint-disable-line no-unused-vars
3030
}
3131
return Promise.resolve(hook);
3232
};
33-
};
33+
};

0 commit comments

Comments
 (0)