Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit 012344f

Browse files
authored
error fix
fixed error when selecting a backup that had no autosave
1 parent 53eeedb commit 012344f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

CrabChampionSaveManager.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ def listBackups():
524524

525525
def getBackups(moreInfo=0, currentSave=False):
526526
global cacheJSON
527+
loadCache()
527528
"""Retrieves the list of backup folders.
528529
529530
Searches the current directory for backup folders and returns a list of their names.
@@ -549,6 +550,13 @@ def getBackups(moreInfo=0, currentSave=False):
549550
]
550551
if currentSave:
551552
folders.insert(0, "Current Save")
553+
554+
for i in range(folders):
555+
try:
556+
if cacheJSON["BackupData"][i]["NoSave"]:
557+
folders.pop(i)
558+
except BaseException:
559+
folders.pop(i)
552560
if moreInfo == 0:
553561
return folders
554562
else:
@@ -562,7 +570,6 @@ def getBackups(moreInfo=0, currentSave=False):
562570
# nosave,if it has a save - ["BackupData"][BackupName]["NoSave"]
563571
ofold = folders
564572
try:
565-
loadCache()
566573
maxLenName = 0
567574
maxLenTime = 0
568575
maxLenDiff = 0

0 commit comments

Comments
 (0)