chuni: fix 'NoneType' object has no attribute 'split' in score.py
This commit is contained in:
parent
58a5177a30
commit
383859388e
@ -179,7 +179,14 @@ class ChuniRomVersion():
|
|||||||
# sort it by version number for easy iteration
|
# sort it by version number for easy iteration
|
||||||
ChuniRomVersion.Versions = dict(sorted(all_versions.items()))
|
ChuniRomVersion.Versions = dict(sorted(all_versions.items()))
|
||||||
|
|
||||||
def __init__(self, rom_version: str) -> None:
|
def __init__(self, rom_version: Optional[str] = None) -> None:
|
||||||
|
if rom_version is None:
|
||||||
|
self.major = 0
|
||||||
|
self.minor = 0
|
||||||
|
self.maint = 0
|
||||||
|
self.version = "0.00.00"
|
||||||
|
return
|
||||||
|
|
||||||
(major, minor, maint) = rom_version.split('.')
|
(major, minor, maint) = rom_version.split('.')
|
||||||
self.major = int(major)
|
self.major = int(major)
|
||||||
self.minor = int(minor)
|
self.minor = int(minor)
|
||||||
@ -343,6 +350,10 @@ class ChuniScoreData(BaseData):
|
|||||||
# for each romVersion recorded, check if it maps back the current version we are operating on
|
# for each romVersion recorded, check if it maps back the current version we are operating on
|
||||||
matching_rom_versions = []
|
matching_rom_versions = []
|
||||||
for v in record_versions:
|
for v in record_versions:
|
||||||
|
# Do this to prevent null romVersion from causing an error in ChuniRomVersion.__init__()
|
||||||
|
if v[0] is None:
|
||||||
|
continue
|
||||||
|
|
||||||
if ChuniRomVersion(v[0]).get_int_version() == version:
|
if ChuniRomVersion(v[0]).get_int_version() == version:
|
||||||
matching_rom_versions += [v[0]]
|
matching_rom_versions += [v[0]]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user