Prevent crashes if no ttyrec files can be associated with a game.
If the postprocessing step finds no ttyrec files created between a game's end and the previous game's end, it will no longer index an empty list and crash. The condition of finding no ttyrec files is still a bug that requires investigation.
This commit is contained in:
parent
340e52a624
commit
2f95935349
1 changed files with 7 additions and 2 deletions
|
|
@ -226,6 +226,11 @@ class Game:
|
|||
lowlim = itsEntries[i-1]["endt"]
|
||||
hilim = itsEntries[i]["endt"]
|
||||
recs = [ k[1] for k in vfilekeys if lowlim <= k[0] < hilim ]
|
||||
if len(recs) == 0:
|
||||
# There inexplicably are no files. TODO log an error.
|
||||
itsEntries[i]["startt"] = lowlim
|
||||
itsEntries[i]["ttyrecs"] = []
|
||||
else:
|
||||
itsEntries[i]["startt"] = recnameToTS(recs[0])
|
||||
itsEntries[i]["ttyrecs"] = recs
|
||||
cur.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue