jprichardson / node-jsonfile

Easily read/write JSON files.
MIT License
1.2k stars 321 forks source link

Writefile with serialisation error but no callback writes empty file #81

Closed bergus closed 7 years ago

bergus commented 7 years ago

I'm pretty certain the line

if (callback) return callback(err, null)

in that catch block should be

if (callback) callback(err, null)
return
RyanZim commented 7 years ago

@bergus You're right; can you submit a PR?

bergus commented 7 years ago

Nah, not interested, I was just looking at the code for this SO question.