Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

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

Conversation

itaisatati
Copy link

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
Copy link
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!

@itaisatati
Copy link
Author

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.

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'.
@Nodejs-Jenkins
Copy link

Can one of the admins verify this patch?

@tjfontaine
Copy link

This is fixed in current releases.

@tjfontaine tjfontaine closed this Feb 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants