mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Prevent crash if sdk_version is "dev"
This commit is contained in:
parent
5c73921943
commit
4c460b6fa5
1 changed files with 5 additions and 2 deletions
|
@ -488,14 +488,17 @@ class Toolbox(QObject, Extension):
|
|||
|
||||
local_version = Version(local_package["package_version"])
|
||||
remote_version = Version(remote_package["package_version"])
|
||||
|
||||
if self._getSDKVersion() == "dev":
|
||||
sdk_version = int(self._plugin_registry.APIVersion)
|
||||
else:
|
||||
sdk_version = int(self._getSDKVersion())
|
||||
can_upgrade = False
|
||||
if remote_version > local_version:
|
||||
can_upgrade = True
|
||||
# A package with the same version can be built to have different SDK versions. So, for a package with the same
|
||||
# version, we also need to check if the current one has a lower SDK version. If so, this package should also
|
||||
# be upgradable.
|
||||
elif remote_version == local_version and local_package.get("sdk_version", 0) < int(self._getSDKVersion()):
|
||||
elif remote_version == local_version and local_package.get("sdk_version", 0) < sdk_version:
|
||||
can_upgrade = True
|
||||
|
||||
return can_upgrade
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue