Skip to content

Commit c7fc8ee

Browse files
committed
Fix to non class objects which are not node values/parameters
1 parent 0e141a2 commit c7fc8ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

martepy/marte2/reader.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,11 @@ def handleChildObjects(parent_obj, function, factory):
207207
elif hasattr(parent_obj, child.name.strip('+').lower()):
208208
setattr(parent_obj, child.name.strip('+').lower(), child.parameters)
209209
else:
210-
parent_obj.objects += [child_obj]
210+
# If it doesn't have a plus, it's not an object
211+
if hasattr(parent_obj, 'parseUnknown'):
212+
parent_obj.parseUnknown(child)
213+
else:
214+
raise ValueError("Unknown child object to parent found in config")
211215

212216
def getRootClass(tree_root, class_name):
213217
''' Iterator that returns the first node in a given tree with a matching class '''

0 commit comments

Comments
 (0)