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,8 +226,13 @@ class Game:
|
||||||
lowlim = itsEntries[i-1]["endt"]
|
lowlim = itsEntries[i-1]["endt"]
|
||||||
hilim = itsEntries[i]["endt"]
|
hilim = itsEntries[i]["endt"]
|
||||||
recs = [ k[1] for k in vfilekeys if lowlim <= k[0] < hilim ]
|
recs = [ k[1] for k in vfilekeys if lowlim <= k[0] < hilim ]
|
||||||
itsEntries[i]["startt"] = recnameToTS(recs[0])
|
if len(recs) == 0:
|
||||||
itsEntries[i]["ttyrecs"] = recs
|
# 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()
|
cur.close()
|
||||||
conn.close()
|
conn.close()
|
||||||
def putIntoDB(self, dictlist, conn):
|
def putIntoDB(self, dictlist, conn):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue