Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

View lookup should return something at least

Even if the path doesn't exist it's better for the lookup
method to return the last path checked. Without a return
value, if one attempts to render a path that doesn't
exist one gets "TypeError: Bad argument" because the
first param for fs.readFile is undefined. If the path is
returned one gets the more helpful "Error: ENOENT, no
such file or directory" along with the string for the
path.
  • Loading branch information...
commit fd5127e6978dee2d174a6f42402a7107ad8d92a0 1 parent e6a15f6
@gsf gsf authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  lib/view.js
View
3  lib/view.js
@@ -66,8 +66,7 @@ View.prototype.lookup = function(path){
if (exists(path)) return path;
// <path>/index.<engine>
- path = join(dirname(path), basename(path, ext), 'index' + ext);
- if (exists(path)) return path;
+ return join(dirname(path), basename(path, ext), 'index' + ext);
};
/**
Please sign in to comment.
Something went wrong with that request. Please try again.