Skip to content

Commit

Permalink
Make Version() tolerate lists with less than 3 elements.
Browse files Browse the repository at this point in the history
Fixes CURA-1421 Update checker not working
  • Loading branch information
sedwards2009 committed May 10, 2016
1 parent 79de020 commit f8703b4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions UM/Version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ def __init__(self, version):
version_list = version.replace("-", ".").replace("_", ".").split(".")
else:
version_list = version
self._major = int(version_list[0])
self._minor = int(version_list[1])
self._revision = int(version_list[2])
self._major = 0
self._minor = 0
self._revision = 0
try:
self._major = int(version_list[0])
self._minor = int(version_list[1])
self._revision = int(version_list[2])
except IndexError:
pass

def getMajor(self):
return self._major
Expand Down

0 comments on commit f8703b4

Please sign in to comment.