add null check
This commit is contained in:
@@ -33,14 +33,14 @@ export class UmbPartialViewTreeServerDataSource extends UmbTreeServerDataSourceB
|
||||
const getRootItems = () => PartialViewResource.getTreePartialViewRoot({});
|
||||
|
||||
const getChildrenOf = (parentUnique: string | null) => {
|
||||
const serializer = new UmbServerPathUniqueSerializer();
|
||||
const parentPath = new UmbServerPathUniqueSerializer().toServerPath(parentUnique);
|
||||
|
||||
if (parentUnique === null) {
|
||||
if (parentPath === null) {
|
||||
return getRootItems();
|
||||
} else {
|
||||
// eslint-disable-next-line local-rules/no-direct-api-import
|
||||
return PartialViewResource.getTreePartialViewChildren({
|
||||
parentPath: serializer.toServerPath(parentUnique),
|
||||
parentPath,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -33,14 +33,14 @@ export class UmbScriptTreeServerDataSource extends UmbTreeServerDataSourceBase<
|
||||
const getRootItems = () => ScriptResource.getTreeScriptRoot({});
|
||||
|
||||
const getChildrenOf = (parentUnique: string | null) => {
|
||||
const serializer = new UmbServerPathUniqueSerializer();
|
||||
const parentPath = new UmbServerPathUniqueSerializer().toServerPath(parentUnique);
|
||||
|
||||
if (parentUnique === null) {
|
||||
if (parentPath === null) {
|
||||
return getRootItems();
|
||||
} else {
|
||||
// eslint-disable-next-line local-rules/no-direct-api-import
|
||||
return ScriptResource.getTreeScriptChildren({
|
||||
parentPath: serializer.toServerPath(parentUnique),
|
||||
parentPath,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -33,14 +33,14 @@ export class UmbStylesheetTreeServerDataSource extends UmbTreeServerDataSourceBa
|
||||
const getRootItems = () => StylesheetResource.getTreeStylesheetRoot({});
|
||||
|
||||
const getChildrenOf = (parentUnique: string | null) => {
|
||||
const serializer = new UmbServerPathUniqueSerializer();
|
||||
const parentPath = new UmbServerPathUniqueSerializer().toServerPath(parentUnique);
|
||||
|
||||
if (parentUnique === null) {
|
||||
if (parentPath === null) {
|
||||
return getRootItems();
|
||||
} else {
|
||||
// eslint-disable-next-line local-rules/no-direct-api-import
|
||||
return StylesheetResource.getTreeStylesheetChildren({
|
||||
parentPath: serializer.toServerPath(parentUnique),
|
||||
parentPath,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user