txn: do another guard check before query just in case

probably won't do anything
This commit is contained in:
William Casarin
2024-01-26 10:55:33 -08:00
parent fbdc5446f0
commit bfb0dbac56

View File

@@ -32,6 +32,7 @@ class NdbTxn<T> {
self.inherited = true self.inherited = true
} else { } else {
self.txn = ndb_txn() self.txn = ndb_txn()
guard !ndb.closed else { return nil }
let ok = ndb_begin_query(ndb.ndb.ndb, &self.txn) != 0 let ok = ndb_begin_query(ndb.ndb.ndb, &self.txn) != 0
if !ok { if !ok {
return nil return nil