Skip to content

Commit

Permalink
Fixes #5 crash on missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Jan 6, 2015
1 parent 3bc675e commit 9bd1b0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ exports.renderFile = function () {
}
else {
read(path, function (err, data) {
var tmpl = data.toString().trim();
var tmpl;
if (err) {
return cb(err);
}
tmpl = data.toString().trim();
if (opts.cache) {
templateCache[path] = tmpl;
}
Expand Down

0 comments on commit 9bd1b0a

Please sign in to comment.