suppress access on null php notice in new is_connected method (#7228)

This commit is contained in:
frytimo 2025-01-23 16:44:36 -04:00 committed by GitHub
parent 5ef71889fe
commit ba1dc820eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -2957,7 +2957,8 @@
*/
public function is_connected(): bool {
try {
$stmt = $this->db->query('SELECT 1');
$stmt = false;
if ($this->db !== null) $stmt = $this->db->query('SELECT 1');
return $stmt !== false;
} catch (PDOException $ex) {
//database is not connected