mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-07 02:04:21 +01:00
feat: only call close if it is open
This commit is contained in:
@@ -206,8 +206,10 @@ impl Database {
|
||||
|
||||
#[napi]
|
||||
pub fn close(&mut self) -> napi::Result<()> {
|
||||
self.conn.close().map_err(into_napi_error)?;
|
||||
self.open = false;
|
||||
if self.open {
|
||||
self.conn.close().map_err(into_napi_error)?;
|
||||
self.open = false;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user