fix: unit test problems

This commit is contained in:
Howard Zhang 2023-12-14 16:15:41 +08:00 committed by xile611
parent e2d1457efd
commit df296bc36a
2 changed files with 4 additions and 1 deletions

View File

@ -106,7 +106,7 @@ export abstract class BaseModel<T extends IModelSpec> extends CompilableBase imp
} }
protected get _theme() { protected get _theme() {
return this.getSpecInfo().theme; return this.getSpecInfo()?.theme;
} }
/** for layout diff */ /** for layout diff */

View File

@ -41,5 +41,8 @@ export const setProperty = <T>(target: T, path: Array<string | number>, value: a
}; };
export const getProperty = <T>(target: any, path: Array<string | number>, defaultValue?: T): T => { export const getProperty = <T>(target: any, path: Array<string | number>, defaultValue?: T): T => {
if (isNil(path)) {
return undefined;
}
return get(target, path as string[], defaultValue) as T; return get(target, path as string[], defaultValue) as T;
}; };