From c19fc266861d1e1c03204a340b5190d33722eedc Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Thu, 25 Jun 2020 14:56:07 +0200 Subject: [PATCH] Update BaseModel.ts --- src/core/BaseModel.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/BaseModel.ts b/src/core/BaseModel.ts index 6aa52ef..39ada1f 100644 --- a/src/core/BaseModel.ts +++ b/src/core/BaseModel.ts @@ -342,8 +342,11 @@ namespace OS { const evt = new BaseEvent("exit", force); this.onexit(evt); if (!evt.prevent) { - this.observable.off("*"); - delete this._observable; + if(this.observable) + { + this.observable.off("*"); + delete this._observable; + } if (this.dialog) { this.dialog.quit(); }