From 8ec1e46ea48bf93b47cda9c393c915de3e8d2e6c Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 21 Apr 2021 15:38:10 -0600 Subject: [PATCH] Etemplate: Catch errors when destroying editor so we can see what's going on, and not break --- api/js/etemplate/et2_widget_htmlarea.js | 7 ++++++- api/js/etemplate/et2_widget_htmlarea.ts | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_widget_htmlarea.js b/api/js/etemplate/et2_widget_htmlarea.js index 2a05826247..44c3ca4c48 100644 --- a/api/js/etemplate/et2_widget_htmlarea.js +++ b/api/js/etemplate/et2_widget_htmlarea.js @@ -307,7 +307,12 @@ var et2_htmlarea = /** @class */ (function (_super) { }; et2_htmlarea.prototype.destroy = function () { if (this.editor) { - this.editor.destroy(); + try { + this.editor.destroy(); + } + catch (e) { + egw().debug("Error destroying editor", e); + } } this.editor = null; this.tinymce = null; diff --git a/api/js/etemplate/et2_widget_htmlarea.ts b/api/js/etemplate/et2_widget_htmlarea.ts index 542f8004e2..c8ce495203 100644 --- a/api/js/etemplate/et2_widget_htmlarea.ts +++ b/api/js/etemplate/et2_widget_htmlarea.ts @@ -469,7 +469,14 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable { if (this.editor) { - this.editor.destroy(); + try + { + this.editor.destroy(); + } + catch(e) + { + egw().debug("Error destroying editor",e); + } } this.editor = null; this.tinymce = null;