Commit 2a1e3840 authored by Morgan McMillian's avatar Morgan McMillian

handle new empty database on startup

parent d103a31d
......@@ -185,7 +185,8 @@ class ChannelMonitor(threading.Thread):
logging.info("-- Starting channel monitor --")
app.app_context().push()
rooms = MatrixRoom2.query.all()
self.txId = int(rooms[0].pnut_since)
if rooms:
self.txId = int(rooms[0].pnut_since)
while not _shutdown.isSet():
rooms = MatrixRoom2.query.all()
for r in rooms:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment