Skip to content
Permalink
Browse files

[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 #31828

Signed-off-by: Fabien Meghazi <amigrave@users.noreply.github.com>
  • Loading branch information...
Icallhimtest committed Mar 12, 2019
1 parent 79d5d57 commit 791a38a655009a063e488c07bb141f35e5a52574
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;

0 comments on commit 791a38a

Please sign in to comment.
You can’t perform that action at this time.