ndb: fix crashed when trying to process client event on a closed db
This commit is contained in:
@@ -373,6 +373,7 @@ class Ndb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func process_client_event(_ str: String) -> Bool {
|
func process_client_event(_ str: String) -> Bool {
|
||||||
|
guard !self.closed else { return false }
|
||||||
return str.withCString { cstr in
|
return str.withCString { cstr in
|
||||||
return ndb_process_client_event(ndb.ndb, cstr, Int32(str.utf8.count)) != 0
|
return ndb_process_client_event(ndb.ndb, cstr, Int32(str.utf8.count)) != 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user