Add null check into FileTypeManager isDirectory check

This commit is contained in:
James Allen 2014-11-24 13:39:07 +00:00
parent d4af0fe36d
commit 3578e41c9c

View file

@ -24,7 +24,8 @@ module.exports = FileTypeManager =
isDirectory: (path, callback = (error, result) ->) ->
fs.stat path, (error, stats) ->
callback(error, stats.isDirectory())
return callback(error) if error?
callback(null, stats?.isDirectory())
isBinary: (name, fsPath, callback = (error, result) ->) ->
parts = name.split(".")