From 5d7dc25a2bd3deb957439229895ae5cfb137ec16 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 12 Sep 2025 15:11:23 +0800 Subject: [PATCH] bugfix --- bricks/wterm.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bricks/wterm.js b/bricks/wterm.js index cea19cc..c68b52b 100644 --- a/bricks/wterm.js +++ b/bricks/wterm.js @@ -45,9 +45,11 @@ bricks.Wterm = class extends bricks.JsWidget { destroy(){ console.debug('------domoff event, destory this widget'); try { - this.unbind('element_resize', this.term_resize.bind(this)) - this.heartbeat_task.cancel(); - this.heartbeat_task = null; + if (this.heartbeat_task){ + this.heartbeat_task.cancel(); + this.heartbeat_task = null; + } + this.unbind('element_resize', this.term_resize.bind(this)) } catch(e) { console.log('error ', e); }