Commit a1797e75 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_xhtml_style: fix json parsing data-gadget-renderjs-extra

When data-gadget-renderjs-extra attribute is not set to an element,
`element.getAttribute("data-gadget-renderjs-extra")` returns null.

Possible error messages :
- sub_key is null
- TypeError: Cannot set property 'key' of null

/reviewed-on nexedi/erp5!602
parent ef234da2
......@@ -118,7 +118,7 @@
editable: (field_element.getAttribute("data-gadget-editable") !== null),
key: field_element.getAttribute("data-gadget-editable"),
value: field_element.getAttribute("data-gadget-value"),
extra: field_element.getAttribute("data-gadget-renderjs-extra")
extra: field_element.getAttribute("data-gadget-renderjs-extra") || "{}"
});
promise_list.push(gadget.getDeclaredGadget(field_scope));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment