Skip to content

Commit 06c5651

Browse files
committed
Merge pull request #7 from apibyexample/nick/bugfix-error-handling
Null passes lodash as undefined
2 parents 0d5a20b + 72667dc commit 06c5651

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/abe-json-builder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ exports.jsonBuilder = function (options, callback) {
3737

3838
if (!fs.existsSync(filePath)) {
3939
mkdirp(filePath, function (err) {
40-
if (!lodash.isUndefined(err)) {
41-
console.log(err.red);
40+
if (err) {
41+
console.log(err);
4242
} else if (opt.verbose) {
4343
console.log(opt.build.yellow, ' created.');
4444
}
@@ -53,8 +53,8 @@ exports.jsonBuilder = function (options, callback) {
5353
file = buildName + baseName + '-' + key + '.json';
5454

5555
fs.writeFile(filePath + file, fileData, function (err) {
56-
if (!lodash.isUndefined(err)) {
57-
console.log(err.red);
56+
if (err) {
57+
console.log(err);
5858
} else if (opt.verbose) {
5959
console.log(file.green, ' file was saved.');
6060
}

0 commit comments

Comments
 (0)