Merge pull request #10486 from Ultimaker/use_empty_qurl_if_path_doesnt_exist

Only return the path if the folder actually exist
This commit is contained in:
Remco Burema 2021-10-08 14:01:01 +02:00 committed by GitHub
commit 2ed837ba71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -750,7 +750,9 @@ class CuraApplication(QtApplication):
@pyqtSlot(str, result = QUrl)
def getDefaultPath(self, key):
default_path = self.getPreferences().getValue("local_file/%s" % key)
return QUrl.fromLocalFile(default_path)
if os.path.exists(default_path):
return QUrl.fromLocalFile(default_path)
return QUrl()
@pyqtSlot(str, str)
def setDefaultPath(self, key, default_path):