Etemplate: Catch errors when destroying editor so we can see what's going on, and not break

This commit is contained in:
nathangray 2021-04-21 15:38:10 -06:00
parent 74a7d6ee8b
commit 8ec1e46ea4
2 changed files with 14 additions and 2 deletions

View File

@ -307,8 +307,13 @@ var et2_htmlarea = /** @class */ (function (_super) {
}; };
et2_htmlarea.prototype.destroy = function () { et2_htmlarea.prototype.destroy = function () {
if (this.editor) { if (this.editor) {
try {
this.editor.destroy(); this.editor.destroy();
} }
catch (e) {
egw().debug("Error destroying editor", e);
}
}
this.editor = null; this.editor = null;
this.tinymce = null; this.tinymce = null;
this.tinymce_container = null; this.tinymce_container = null;

View File

@ -468,9 +468,16 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable
destroy() destroy()
{ {
if (this.editor) if (this.editor)
{
try
{ {
this.editor.destroy(); this.editor.destroy();
} }
catch(e)
{
egw().debug("Error destroying editor",e);
}
}
this.editor = null; this.editor = null;
this.tinymce = null; this.tinymce = null;
this.tinymce_container = null; this.tinymce_container = null;