mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Handle attempting to remove a favorite material that was already removed
This commit is contained in:
parent
e718bed151
commit
d928e0979d
1 changed files with 6 additions and 2 deletions
|
@ -683,7 +683,11 @@ class MaterialManager(QObject):
|
|||
|
||||
@pyqtSlot(str)
|
||||
def removeFavorite(self, root_material_id: str) -> None:
|
||||
self._favorites.remove(root_material_id)
|
||||
try:
|
||||
self._favorites.remove(root_material_id)
|
||||
except KeyError:
|
||||
Logger.log("w", "Could not delete material %s from favorites as it was already deleted", root_material_id)
|
||||
return
|
||||
self.materialsUpdated.emit()
|
||||
|
||||
# Ensure all settings are saved.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue