Fix for fs.appendFile failure when a callback isn't passed and an is error returned #3853

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@crazyrobot

Documentation for 'fs.appendFile' marks the 'callback' argument as optional, but the code would fail if not passed a callback function and an error has occurred.

The code defaulted to 'null' which was later called as a function in the case of an error.

Fixed to use (the already defined) 'makeCallback' function.

@bnoordhuis
Member

LGTM if it works as advertised. However:

  1. Can you add a regression test or two?
  2. Can you rework the commit message as described here?
  3. Last but not least, can you sign the CLA?

Thanks!

@crazyrobot

Sorry about that. My fault for not searching the notes about contributing.
Will fix the commit message and sign the CLA now and take care of the test tomorrow.

@crazyrobot crazyrobot fs: fix appendFile() error using null as function
Code defaulted to 'null' if a callback wasn't provided which would later be called as a function in the case of an error.
Changed to use 'makeCallback' like on 'fs.symlink'.
9c38d69
@Nodejs-Jenkins

Can one of the admins verify this patch?

@tjfontaine

This is fixed in current releases.

@tjfontaine tjfontaine closed this Feb 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment