|
@@ -69,12 +69,12 @@ function tryLoadTemplateFile(fileName) {
|
|
|
function tryLoadTemplate() {
|
|
function tryLoadTemplate() {
|
|
|
var template;
|
|
var template;
|
|
|
|
|
|
|
|
- if (!this.urlParts[0]) {
|
|
|
|
|
|
|
+ if (this.urlParts.length === 0) {
|
|
|
template = tryLoadTemplateFile(__dirname +'/../template/index.js');
|
|
template = tryLoadTemplateFile(__dirname +'/../template/index.js');
|
|
|
} else if (this.urlParts[0][0] !== '_') {
|
|
} else if (this.urlParts[0][0] !== '_') {
|
|
|
template = tryLoadTemplateFile(__dirname +'/../template/' +this.urlParts[0] +'.js');
|
|
template = tryLoadTemplateFile(__dirname +'/../template/' +this.urlParts[0] +'.js');
|
|
|
}
|
|
}
|
|
|
- if (!template || (template.match && !template.match(this)) || (!template.match && this.urlParts[0].length > 1)) {
|
|
|
|
|
|
|
+ if (!template || (template.match && !template.match(this)) || (!template.match && this.urlParts.length && this.urlParts[0].length > 1)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
this.template = template;
|
|
this.template = template;
|