mikeal/node-utils — pull request #20 by brisryan (2012-04-04 03:00:05+00:00)
Title: Handle undefined response in callback.

fs.readdir's callback returns an array of files, or undefined.

This change adds some checking for undefined to prevent fatal exception:

----------------------
/Users/rforrester/node_modules/file/lib/file.js:119
var coll = files.reduce(function (acc, i) {
^
TypeError: Cannot call method 'reduce' of undefined
at Object.oncomplete (/Users/rforrester/node_modules/file/lib/file.js:119:28)
----------------------