From e047130314a9c06c2bbb43ffe2e1c4514f856d89 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 5 Oct 2015 11:18:31 +0200 Subject: [PATCH] [FIX] web_editor: oStyle.range can be undefined On initialisation summernote call update method with oStyle.range is undefined. The range can be undefined because the update is call before any selection and attach method from summernote call the update without range. The method summernote_table_update try to use the range and raise an exception. fix: Check if oStyle.range exits. --- addons/web_editor/static/src/js/summernote.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index 569d769f801..eda0e33cf5f 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -2170,7 +2170,7 @@ function summernote_table_scroll (event) { } function summernote_table_update (oStyle) { var r = range.create(); - if (!r || !r.isOnCell() || !r.isOnCellFirst()) { + if (!oStyle.range || !r || !r.isOnCell() || !r.isOnCellFirst()) { $('.o_table_handler').remove(); return; }