Skip to content

Commit 6abb4c6

Browse files
committed
Null safety in destructor
1 parent 07c3666 commit 6abb4c6

File tree

1 file changed

+1
-1
lines changed
  • src/Codeception/Lib/Driver

1 file changed

+1
-1
lines changed

src/Codeception/Lib/Driver/Db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function __construct($dsn, $user, $password, $options = null)
103103

104104
public function __destruct()
105105
{
106-
if ($this->dbh->inTransaction()) {
106+
if ($this->dbh !== null && $this->dbh->inTransaction()) {
107107
$this->dbh->rollBack();
108108
}
109109
$this->dbh = null;

0 commit comments

Comments
 (0)