mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-20 05:13:11 -06:00
Handle nil in transaction
This commit is contained in:
parent
a420a4f072
commit
7c63b5cbb4
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue