Don't crash on NotADirectoryError or PermissionError when trying to load custom intent icons

CURA-9709
This commit is contained in:
c.lamboo 2023-06-14 13:52:47 +02:00
parent 4a38439886
commit fec5ebb709

View file

@ -115,7 +115,7 @@ class IntentSelectionModel(ListModel):
try:
icon = QUrl.fromLocalFile(
Resources.getPath(cura.CuraApplication.CuraApplication.ResourceTypes.ImageFiles, icon))
except FileNotFoundError:
except (FileNotFoundError, NotADirectoryError, PermissionError):
Logger.log("e", f"Icon file for intent {intent_name} not found.")
icon = None