Handle null connection and suppress exceptions in DB close method
This commit is contained in:
@@ -82,7 +82,14 @@ class db
|
||||
|
||||
public function close(): void
|
||||
{
|
||||
$this->conn->close();
|
||||
if (!isset($this->conn)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$this->conn->close();
|
||||
} catch (\Throwable) {
|
||||
}
|
||||
}
|
||||
|
||||
public function get(string $table, int $id)
|
||||
|
||||
Reference in New Issue
Block a user