Permalink
Browse files

There are cases where the files list is empty, but yet not an error

  • Loading branch information...
1 parent 2d7027d commit f33fb1b4ee07231e9c3987841d000a7069c94069 @isaacs isaacs committed Mar 25, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/utils/completion/file-completion.js
View
2 lib/utils/completion/file-completion.js
@@ -17,7 +17,7 @@ function fileCompletion (root, req, depth, cb) {
}
find(path.join(root, req), dirFilter, depth, function (er, files) {
if (er) return cb(er)
- return cb(null, files.map(function (f) {
+ return cb(null, (files || []).map(function (f) {
return path.join(req, f.substr(root.length + 1)
.substr((f === req ? path.dirname(req)
: req).length)

0 comments on commit f33fb1b

Please sign in to comment.