Avoid "KeyError: material_name" crash in Fedora

Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/UM/Qt/ListModel.py", line 54, in data
        return self._items[index.row()][self._role_names[role].decode("utf-8")]
               ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    KeyError: 'material_name'

Downstream report: https://bugzilla.redhat.com/show_bug.cgi?id=2252195
Community: https://community.ultimaker.com/topic/44538-cura-53-crashs-at-startup/

For reasons unknown, this crash does not happen with the AppImage.

Nevertheless, in 2baada8a70b15dd87948a25855e17d15b0ece58c
material_name was added as a role, not material_label.
Reaming the field in the sentinel extruder makes the crash go away.
This commit is contained in:
Miro Hrončok 2023-12-14 12:52:26 +01:00 committed by GitHub
parent 841ba2d16a
commit 1941fbe90b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -227,7 +227,7 @@ class ExtrudersModel(ListModel):
"material_brand": "",
"color_name": "",
"material_type": "",
"material_label": ""
"material_name": ""
}
items.append(item)
if self._items != items: