diff --git a/pnut-bridge.py b/pnut-bridge.py index 0506060..c313805 100644 --- a/pnut-bridge.py +++ b/pnut-bridge.py @@ -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: