changeset 2424:467ddb437a71

frontends (xmlui): fixed crash on advanced_list use: the data variable was set to None but kept for other nodes, resulting in a crash in a later test where a dict was expected.
author Goffi <goffi@goffi.org>
date Wed, 08 Nov 2017 08:31:21 +0100
parents e3edbccd26d7
children d294527bd46f
files frontends/src/tools/xmlui.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/tools/xmlui.py	Wed Nov 08 07:47:01 2017 +0100
+++ b/frontends/src/tools/xmlui.py	Wed Nov 08 08:31:21 2017 +0100
@@ -377,9 +377,9 @@
         @param wanted: list of tag names that can be present in the childs to be SàT XMLUI compliant
         @param data(None, dict): additionnal data which are needed in some cases
         """
-        if data is None:
-            data = {}
         for node in current_node.childNodes:
+            if data is None:
+                data = {}
             if wanted and not node.nodeName in wanted:
                 raise InvalidXMLUI('Unexpected node: [%s]' % node.nodeName)