Do not iterate over MultiSelection value of Dict key if it is null

Closes #13375
(grafted from d938889e4f42517b7433685091e6cfce5080063a)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2024-06-30 01:53:24 +02:00
parent 8952b53808
commit c0fbbb9db0
2 changed files with 7 additions and 4 deletions
+3 -1
View File
@@ -5215,7 +5215,9 @@ function eval_pyson(value){
return value.map(function(e) { return JSON.parse(e); });
},
set_value: function(value) {
value = value.map(function(e) { return JSON.stringify(e); });
if (value) {
value = value.map(function(e) { return JSON.stringify(e); });
}
this.input.val(value);
}
});
@@ -241,9 +241,10 @@ class DictMultiSelectionEntry(DictEntry):
selection.handler_block_by_func(self._changed)
try:
selection.unselect_all()
for v in value:
if v in value2path:
selection.select_path(value2path[v])
if value:
for v in value:
if v in value2path:
selection.select_path(value2path[v])
finally:
selection.handler_unblock_by_func(self._changed)