From 1b82374262bf2003d38283d7a2e2502707bfeea2 Mon Sep 17 00:00:00 2001 From: jpr-odoo Date: Wed, 24 Feb 2021 07:16:24 +0000 Subject: [PATCH] [FIX] web_editor: prevent traceback when custom color area is excluded Bug since the combination of [1] and [2]. [1]: https://github.com/odoo/odoo/commit/1c1894d6d976806be6951db54a3b741dfd093ece [2]: https://github.com/odoo/odoo/commit/8b5640b46a33fec5fdac4b19ea354e67211e8e46 task-2464340 closes odoo/odoo#67364 X-original-commit: d7a540c545cfe2500b08f5d6dfb6fe99747cc7de Signed-off-by: Quentin Smetz (qsm) --- .../web_editor/static/src/js/wysiwyg/widgets/color_palette.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js b/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js index 9177863e758..f6e66dc7c69 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js @@ -274,7 +274,9 @@ const ColorPaletteWidget = Widget.extend({ } this._buildCustomColors(); this._markSelectedColor(); - this.colorPicker.setSelectedColor(colorInfo.color); + if (this.colorPicker) { + this.colorPicker.setSelectedColor(colorInfo.color); + } }, /** * Mark the selected color