mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
throw error if page not specified
This commit is contained in:
@@ -217,7 +217,11 @@ function loadCustomComponent(componentPath: string, componentName?: string, attr
|
||||
// Add component CSS file if exists.
|
||||
var cssFileName = fileName.replace(".xml", ".css");
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user