diff --git a/addons/website/static/lib/summernote/src/js/module/Popover.js b/addons/website/static/lib/summernote/src/js/module/Popover.js index ec40dc6e7d4..e0531f06c45 100644 --- a/addons/website/static/lib/summernote/src/js/module/Popover.js +++ b/addons/website/static/lib/summernote/src/js/module/Popover.js @@ -71,11 +71,14 @@ define([ var $airPopover = $popover.find('.note-air-popover'); if (isAirMode && !styleInfo.range.isCollapsed()) { - var bnd = func.rect2bnd(list.last(styleInfo.range.getClientRects())); - showPopover($airPopover, { - left: Math.max(bnd.left + bnd.width / 2 - PX_POPOVER_ARROW_OFFSET_X, 0), - top: bnd.top + bnd.height - }); + var rect = list.last(styleInfo.range.getClientRects()); + if (rect) { + var bnd = func.rect2bnd(rect); + showPopover($airPopover, { + left: Math.max(bnd.left + bnd.width / 2 - PX_POPOVER_ARROW_OFFSET_X, 0), + top: bnd.top + bnd.height + }); + } } else { $airPopover.hide(); }