Skip to content

Commit

Permalink
fix: resource parser error (#1105)
Browse files Browse the repository at this point in the history
  • Loading branch information
gz65555 authored Oct 17, 2022
1 parent f4e23d6 commit 4b8d3b3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class ReflectionParser {
): Promise<any> {
if (Array.isArray(value)) {
return Promise.all(value.map((item) => this.parseBasicType(item, engine, resourceManager)));
} else if (typeof value === "object") {
} else if (typeof value === "object" && value != null) {
if (this._isClass(value)) {
// 类对象
return this.parseClassObject(value, engine, resourceManager);
Expand Down Expand Up @@ -127,10 +127,10 @@ export class ReflectionParser {
}

private static _isClass(value: any): value is IClassObject {
return "class" in value;
return value["class"] != undefined;
}

private static _isRef(value: any): value is IReferenceType {
return "refId" in value;
return value["refId"] != undefined;
}
}

0 comments on commit 4b8d3b3

Please sign in to comment.