From fec5ebb70986f8ee1b6d50354b81f3506918e5e3 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Wed, 14 Jun 2023 13:52:47 +0200 Subject: [PATCH] Don't crash on NotADirectoryError or PermissionError when trying to load custom intent icons CURA-9709 --- cura/Machines/Models/IntentSelectionModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Machines/Models/IntentSelectionModel.py b/cura/Machines/Models/IntentSelectionModel.py index c239472b96..603244a12b 100644 --- a/cura/Machines/Models/IntentSelectionModel.py +++ b/cura/Machines/Models/IntentSelectionModel.py @@ -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