Allow setting metadata subentries that don't exist yet

Otherwise it crashes here. The ContainerManager should be flexible enough to allow that sort of thing.
It works with plain entries, but crashed with subentries (like 'properties/diameter') if those weren't present yet in the metadata.

Fixes Sentry issue CURA-3FH.
This commit is contained in:
Ghostkeeper 2022-06-08 11:24:46 +02:00
parent 0f12b012cf
commit 4a08b88f31
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -114,7 +114,7 @@ class ContainerManager(QObject):
for _ in range(len(entries)):
item = item.get(entries.pop(0), {})
if item[entry_name] != entry_value:
if entry_name not in item or item[entry_name] != entry_value:
sub_item_changed = True
item[entry_name] = entry_value