mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 09:17:50 -06:00
Fixed hard crash when deconstructing RemotePackageList while parsing
Contributes to CURA-8558
This commit is contained in:
parent
fd409215c4
commit
a0467cd66f
1 changed files with 8 additions and 2 deletions
|
@ -107,8 +107,14 @@ class RemotePackageList(PackageList):
|
||||||
return
|
return
|
||||||
|
|
||||||
for package_data in response_data["data"]:
|
for package_data in response_data["data"]:
|
||||||
|
try:
|
||||||
package = PackageModel(package_data, parent = self)
|
package = PackageModel(package_data, parent = self)
|
||||||
self.appendItem({"package": package}) # Add it to this list model.
|
self.appendItem({"package": package}) # Add it to this list model.
|
||||||
|
except RuntimeError:
|
||||||
|
# Setting the ownership of this object to not qml can still result in a RuntimeError. Which can occur when quickly toggling
|
||||||
|
# between de-/constructing RemotePackageLists. This try-except is here to prevent a hard crash when the wrapped C++ object
|
||||||
|
# was deleted when it was still parsing the response
|
||||||
|
return
|
||||||
|
|
||||||
self._request_url = response_data["links"].get("next", "") # Use empty string to signify that there is no next page.
|
self._request_url = response_data["links"].get("next", "") # Use empty string to signify that there is no next page.
|
||||||
self._ongoing_request = None
|
self._ongoing_request = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue