diff --git a/py/rlgall.py b/py/rlgall.py index 6188375..175f04f 100644 --- a/py/rlgall.py +++ b/py/rlgall.py @@ -226,8 +226,13 @@ class Game: lowlim = itsEntries[i-1]["endt"] hilim = itsEntries[i]["endt"] recs = [ k[1] for k in vfilekeys if lowlim <= k[0] < hilim ] - itsEntries[i]["startt"] = recnameToTS(recs[0]) - itsEntries[i]["ttyrecs"] = recs + 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() conn.close() def putIntoDB(self, dictlist, conn):