Skip to content

Commit

Permalink
fix: setContext on undefined reference
Browse files Browse the repository at this point in the history
  • Loading branch information
loopingz committed Oct 7, 2023
1 parent ed21b09 commit 030db1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/models/coremodel.ts
Expand Up @@ -337,7 +337,7 @@ export class ModelRef<T extends CoreModel> {
this.store = Core.get().getModelStore(model);
}
async get(context?: OperationContext): Promise<T> {
return (await this.store.get(this.uuid)).setContext(context);
return (await this.store.get(this.uuid))?.setContext(context);
}
set(id: string | T) {
this.uuid = id instanceof CoreModel ? id.getUuid() : id;
Expand Down

0 comments on commit 030db1b

Please sign in to comment.