From dacd69c549224bd145a3889d11a616901afb3c8b Mon Sep 17 00:00:00 2001 From: Thanh Dodeur Date: Mon, 14 Sep 2020 09:20:24 +0000 Subject: [PATCH] [FIX] website: fix google map snippet traceback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit before this commit, when selectioning the snippet with an invalid API key, a traceback was triggered and the snippet was destroyed. task-2338730 closes odoo/odoo#57689 X-original-commit: 2c5b0c6b915546ccdac2ed4248f24a4e691fadd1 Signed-off-by: Quentin Smetz (qsm) Signed-off-by: Jérémy Kersten (jke) --- addons/website/static/src/js/editor/snippets.options.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 028bbdb4963..082f6cba958 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -316,7 +316,9 @@ const GPSPicker = InputUserValueWidget.extend({ } }); }); - this.inputEl.value = this._gmapPlace.formatted_address; + if (this._gmapPlace) { + this.inputEl.value = this._gmapPlace.formatted_address; + } }, //--------------------------------------------------------------------------