mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Add some error checking for an invalid template path
This commit is contained in:
parent
d60a21b40d
commit
2ad817a20d
@ -76,7 +76,7 @@ Template.prototype = {
|
||||
out = new AsyncWriter(out);
|
||||
shouldEnd = true;
|
||||
}
|
||||
|
||||
|
||||
out.on('finish', function() {
|
||||
callback(null, out.getOutput());
|
||||
});
|
||||
@ -155,6 +155,10 @@ if (stream) {
|
||||
}
|
||||
|
||||
function load(templatePath) {
|
||||
if (!templatePath) {
|
||||
throw new Error('"templatePath" is required');
|
||||
}
|
||||
|
||||
var template;
|
||||
|
||||
if (typeof templatePath === 'string') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user