diff options
Diffstat (limited to 'node_modules/jsonfile/index.js')
-rw-r--r-- | node_modules/jsonfile/index.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/node_modules/jsonfile/index.js b/node_modules/jsonfile/index.js index 5ac06cfff..a28684f60 100644 --- a/node_modules/jsonfile/index.js +++ b/node_modules/jsonfile/index.js @@ -94,7 +94,9 @@ function writeFile (file, obj, options, callback) { try { str = JSON.stringify(obj, options ? options.replacer : null, spaces) + '\n' } catch (err) { - if (callback) return callback(err, null) + // Need to return whether a callback was passed or not + if (callback) callback(err, null) + return } fs.writeFile(file, str, options, callback) |