Explorar el Código

Add null check into FileTypeManager isDirectory check

James Allen hace 12 años
padre
commit
3578e41c9c

+ 2 - 1
services/web/app/coffee/Features/Uploads/FileTypeManager.coffee

@@ -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(".")