[FIX] mass_mailing: prevent traceback in _getCSSColorValue

mass_mailing has an override of _getCSSColorValue which was basically
never used since the option it's linked to was mostly inactive. Now it's
active it became obvious there is a mistake in it that causes a
traceback to occur when no color is passed to it. This adds the same
check as in the original method and thereby prevents the traceback.

task-2760157

closes odoo/odoo#84926

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Antoine Guenet
2022-03-28 10:45:46 +02:00
parent 6d23353e5e
commit db5b64317e
@@ -205,6 +205,9 @@ options.registry.ImageTools.include({
* @override
*/
_getCSSColorValue(color) {
if (!color || ColorpickerWidget.isCSSColor(color)) {
return color;
}
const doc = this.options.document;
if (doc && doc.querySelector('.o_mass_mailing_iframe') && !ColorpickerWidget.isCSSColor(color)) {
const tempEl = doc.body.appendChild(doc.createElement('div'));