From a41f91549335b56b24143c68e16fd6330a4f82b9 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 21 Sep 2015 10:30:00 +0200 Subject: [PATCH] [FIX] web_editor: iframe of html widget must be checked before render value If the iframe is destroyed, detached, hide (eg: click on a record, return into the list view and click on an other record), the render_value method try to resize the iframe but jQery raise an exception because contentWindow doesn't exist. --- addons/web_editor/static/src/js/backend.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js index 062b91bd7a2..0b0851a19f5 100644 --- a/addons/web_editor/static/src/js/backend.js +++ b/addons/web_editor/static/src/js/backend.js @@ -295,7 +295,9 @@ var FieldTextHtml = widget.extend({ } } else { this.$content.html(value); - this.$iframe.css("height", (this.$body.height()+20) + "px"); + if (this.$iframe[0].contentWindow) { + this.$iframe.css("height", (this.$body.height()+20) + "px"); + } } }, is_false: function() {