Permalink
Browse files

Fix npm/npm#2080 Don't wrap undefined chown methods

  • Loading branch information...
1 parent 6270b09 commit 019400b140cdb740e67391f033a8cce1529fd4f6 @isaacs committed Jan 23, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 graceful-fs.js
View
@@ -224,6 +224,7 @@ fs.fchownSync = chownFixSync(fs.fchownSync)
fs.lchownSync = chownFixSync(fs.lchownSync)
function chownFix (orig) {
+ if (!orig) return orig
return function (target, uid, gid, cb) {
return orig.call(fs, target, uid, gid, function (er, res) {
if (chownErOk(er)) er = null
@@ -233,6 +234,7 @@ function chownFix (orig) {
}
function chownFixSync (orig) {
+ if (!orig) return orig
return function (target, uid, gid) {
try {
return orig.call(fs, target, uid, gid)

0 comments on commit 019400b

Please sign in to comment.