From 791a38a655009a063e488c07bb141f35e5a52574 Mon Sep 17 00:00:00 2001 From: Denis Vermylen Date: Tue, 12 Mar 2019 16:15:39 +0000 Subject: [FIX] web: qweb2: allow null values in a foreach iteration Before this commit iteration in a t-foreach containing null or undefined values crashed because they have no attributes. closes odoo/odoo#31828 Signed-off-by: Fabien Meghazi --- addons/web/static/lib/qweb/qweb2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web') diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index 378c5eb6023..f59318ff910 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -173,7 +173,7 @@ var QWeb2 = { new_dict[as_first] = index === 0; new_dict[as_last] = index + 1 === size; new_dict[as_parity] = (index % 2 == 1 ? 'odd' : 'even'); - if (cur.constructor === Object) { + if (cur && cur.constructor === Object) { this.extend(new_dict, cur); } new_dict[as] = cur; -- cgit v1.2.3