[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.
This commit is contained in:
Christophe Matthieu
2015-10-06 10:44:37 +02:00
parent afa361f86e
commit e047130314
@@ -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;
}