mirror of
https://github.com/NinjaCheetah/libWiiPy.git
synced 2025-04-26 05:11:02 -04:00
Fix adding content to the content map if it is empty
This commit is contained in:
parent
817a2c9ac5
commit
76b773ee36
@ -586,7 +586,10 @@ class SharedContentMap:
|
|||||||
|
|
||||||
# Generate the file name for the new shared content by incrementing the highest name by 1. Thank you, Nintendo,
|
# Generate the file name for the new shared content by incrementing the highest name by 1. Thank you, Nintendo,
|
||||||
# for not just storing these as integers like you did EVERYWHERE else.
|
# for not just storing these as integers like you did EVERYWHERE else.
|
||||||
|
try:
|
||||||
maximum_index = int(self.shared_records[-1].shared_id, 16)
|
maximum_index = int(self.shared_records[-1].shared_id, 16)
|
||||||
new_index = f"{maximum_index + 1:08X}"
|
new_index = f"{maximum_index + 1:08X}"
|
||||||
|
except IndexError:
|
||||||
|
new_index = f"{0:08X}"
|
||||||
self.shared_records.append(_SharedContentRecord(new_index, content_hash_converted))
|
self.shared_records.append(_SharedContentRecord(new_index, content_hash_converted))
|
||||||
return new_index
|
return new_index
|
||||||
|
Loading…
x
Reference in New Issue
Block a user