ndb: use is_closed which also check nil ptrs

not an issue atm, but maybe in the future
This commit is contained in:
William Casarin
2024-01-26 14:02:03 -08:00
parent 851bffed0f
commit 6ae326d193
3 changed files with 12 additions and 8 deletions

View File

@@ -35,7 +35,7 @@ class NdbTxn<T> {
self.generation = Thread.current.threadDictionary["txn_generation"] as! Int
} else {
self.txn = ndb_txn()
guard !ndb.closed else { return nil }
guard !ndb.is_closed else { return nil }
self.generation = ndb.generation
let ok = ndb_begin_query(ndb.ndb.ndb, &self.txn) != 0
if !ok {