Fix logic oops when deciding whether to use a transaction in storeEvent

This commit is contained in:
Neil Alexander 2022-02-11 17:07:24 +00:00
parent 31b2d1f37c
commit c3e85313eb
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -553,7 +553,7 @@ func (d *Database) storeEvent(
err error
)
var txn *sql.Tx
if updater == nil || updater.txn != nil {
if updater != nil && updater.txn != nil {
txn = updater.txn
}
err = d.Writer.Do(d.DB, txn, func(txn *sql.Tx) error {