diff --git a/roomserver/storage/shared/prepare.go b/roomserver/storage/shared/prepare.go index e048d43af..65ceec1cc 100644 --- a/roomserver/storage/shared/prepare.go +++ b/roomserver/storage/shared/prepare.go @@ -43,10 +43,18 @@ type transaction struct { // Commit implements types.Transaction func (t *transaction) Commit() error { + if t.txn == nil { + // The Updater structs can operate in useTxns=false mode. The code will still call this though. + return nil + } return t.txn.Commit() } // Rollback implements types.Transaction func (t *transaction) Rollback() error { + if t.txn == nil { + // The Updater structs can operate in useTxns=false mode. The code will still call this though. + return nil + } return t.txn.Rollback() }