diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-01-08 16:58:19 +0100 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-01-16 17:03:10 +0100 |
| commit | 0dd41128ffa460bad4db78f28852e785dbbeab95 (patch) | |
| tree | 4fb45dacf9f4fc5dd7d3a3e1a4420878e8d73cae /addons/web_editor/static/src/js | |
| parent | 0b32d3fe614ad2f96cc50d31b8feebb3474a1ce7 (diff) | |
[FIX] web_editor: fix 8ca92330b367d54fddf1c02089ee9d0bc3edbfdc
The existence of $li is not sure, especially in themes override.
Diffstat (limited to 'addons/web_editor/static/src/js')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.options.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 6c6a33edb8b..90807565990 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -126,8 +126,8 @@ var SnippetOption = Widget.extend({ * @param {jQuery} $li - the related DOMElement option */ selectClass: function (previewMode, value, $li) { - var $group = $li.closest('.dropdown-submenu'); - if (!$group.length) { + var $group = $li && $li.closest('.dropdown-submenu'); + if (!$group || !$group.length) { $group = this.$el; } var $lis = $group.find('[data-select-class]').addBack('[data-select-class]'); |
