throw error if page not specified

This commit is contained in:
Vladimir Enchev
2015-07-09 11:26:27 +03:00
parent 7aae543bd7
commit 56444fb927

View File

@@ -217,7 +217,11 @@ function loadCustomComponent(componentPath: string, componentName?: string, attr
// Add component CSS file if exists. // Add component CSS file if exists.
var cssFileName = fileName.replace(".xml", ".css"); var cssFileName = fileName.replace(".xml", ".css");
if (fs.File.exists(cssFileName) && parentPage) { if (fs.File.exists(cssFileName) && parentPage) {
parentPage.addCssFile(cssFileName); if (parentPage) {
parentPage.addCssFile(cssFileName);
} else {
throw new Error("CSS file found but no page specified. Please specify page in the options!");
}
} }
return result; return result;