mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 00:35:13 +08:00
Don't crash when failing to reload file
Now it shows a message that it failed to load the file.
This commit is contained in:
parent
1c3bae3fe4
commit
77feb95191
@ -1500,11 +1500,15 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
def _reloadMeshFinished(self, job):
|
def _reloadMeshFinished(self, job):
|
||||||
# TODO; This needs to be fixed properly. We now make the assumption that we only load a single mesh!
|
# TODO; This needs to be fixed properly. We now make the assumption that we only load a single mesh!
|
||||||
mesh_data = job.getResult()[0].getMeshData()
|
job_result = job.getResult()
|
||||||
if mesh_data:
|
if len(job_result) == 0:
|
||||||
job._node.setMeshData(mesh_data)
|
Logger.log("e", "Reloading the mesh failed.")
|
||||||
else:
|
return
|
||||||
|
mesh_data = job_result[0].getMeshData()
|
||||||
|
if not mesh_data:
|
||||||
Logger.log("w", "Could not find a mesh in reloaded node.")
|
Logger.log("w", "Could not find a mesh in reloaded node.")
|
||||||
|
return
|
||||||
|
job._node.setMeshData(mesh_data)
|
||||||
|
|
||||||
def _openFile(self, filename):
|
def _openFile(self, filename):
|
||||||
self.readLocalFile(QUrl.fromLocalFile(filename))
|
self.readLocalFile(QUrl.fromLocalFile(filename))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user