diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 1c66fa4d7b..852eadf393 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1242,10 +1242,14 @@ class CuraApplication(QtApplication): """ Checks if the given file URL is a valid project file. """ - file_path = QUrl(file_url).toLocalFile() - workspace_reader = self.getWorkspaceFileHandler().getReaderForFile(file_path) - if workspace_reader is None: - return False # non-project files won't get a reader + try: + file_path = QUrl(file_url).toLocalFile() + workspace_reader = self.getWorkspaceFileHandler().getReaderForFile(file_path) + if workspace_reader is None: + return False # non-project files won't get a reader - result = workspace_reader.preRead(file_path, show_dialog=False) - return result == WorkspaceReader.PreReadResult.accepted + result = workspace_reader.preRead(file_path, show_dialog=False) + return result == WorkspaceReader.PreReadResult.accepted + except Exception as e: + Logger.log("e", "Could not check file %s: %s", file_url, e) + return False