From 2720072b23593c87e7909d12c75c5b136e1bdf99 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Fri, 30 Jul 2021 16:31:42 +0100 Subject: [PATCH] Text editor: fix crash when assigning new value to file input controls Fixes #5911 --- core/modules/editor/engines/framed.js | 6 +++++- core/modules/editor/engines/simple.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/modules/editor/engines/framed.js b/core/modules/editor/engines/framed.js index 2266ce742..45958ff06 100644 --- a/core/modules/editor/engines/framed.js +++ b/core/modules/editor/engines/framed.js @@ -135,7 +135,11 @@ FramedEngine.prototype.setText = function(text,type) { Update the DomNode with the new text */ FramedEngine.prototype.updateDomNodeText = function(text) { - this.domNode.value = text; + try { + this.domNode.value = text; + } catch(e) { + // Ignore + } }; /* diff --git a/core/modules/editor/engines/simple.js b/core/modules/editor/engines/simple.js index fe65d1fd9..e1b6bda64 100644 --- a/core/modules/editor/engines/simple.js +++ b/core/modules/editor/engines/simple.js @@ -85,7 +85,11 @@ SimpleEngine.prototype.setText = function(text,type) { Update the DomNode with the new text */ SimpleEngine.prototype.updateDomNodeText = function(text) { - this.domNode.value = text; + try { + this.domNode.value = text; + } catch(e) { + // Ignore + } }; /*