Skip to content

Commit 4ec1208

Browse files
authored
Merge pull request #33 from Codeception/issue-32
Null safety in destructor
2 parents 8f97f19 + e3a875d commit 4ec1208

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
@@ -91,7 +91,7 @@ public function __construct(string $dsn, string $user = null, string $password =
9191

9292
public function __destruct()
9393
{
94-
if ($this->dbh->inTransaction()) {
94+
if ($this->dbh !== null && $this->dbh->inTransaction()) {
9595
$this->dbh->rollBack();
9696
}
9797

0 commit comments

Comments
 (0)