Permalink
Browse files

fix unknown plug server crash

  • Loading branch information...
1 parent a9c6b88 commit 1263434371144f10787cb36ec11a7c1f61bd7768 @jankeromnes committed May 21, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/plug.js
View
@@ -27,8 +27,11 @@ exports.resolve = function (query, path, endres, ask) {
endres(data || {});
} else {
if (nodepath.extname(plug).length === 0) plug += '.html';
- path[0] = plug;
- endres(data || {});
+ fs.file(plug, function(err, file) {
+ // TODO template with file.content instead of giving plug path
+ path[0] = (err ? path[1] : plug);
+ endres(data || {});
+ });
}
}

0 comments on commit 1263434

Please sign in to comment.