From 5a93e4fe0b6f608bb8c04e1d5d118509c231659a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souk=C3=A9ina=20Bojabza?= Date: Thu, 15 Sep 2022 15:43:39 +0000 Subject: [PATCH] [FIX] web_editor: solve bug when removing all columns of the footer When removing all the columns of a block with no parent, like the footer, a traceback was appearing because updateUIVisibility was trying to access the properties of an inexisting parent. This commit fixes that by first checking if the parent exists. task-2973198 X-original-commit: 3e7ad08581295af6a986ba2b81ec25d9cd78e91d Part-of: odoo/odoo#102525 --- addons/web_editor/static/src/js/editor/snippets.options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 987e74e59c3..b88ad29fd7a 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -4430,7 +4430,7 @@ registry.sizing = SnippetOptionWidget.extend({ const isMobileView = this.$target[0].ownerDocument.defaultView.frameElement.clientWidth < 768; const isGrid = this.$target[0].classList.contains('o_grid_item'); - if (this.$target[0].parentNode.classList.contains('row')) { + if (this.$target[0].parentNode && this.$target[0].parentNode.classList.contains('row')) { // Hiding/showing the correct resize handles if we are in grid mode // or not. for (const handleEl of this.$handles) {