Skip to content

Commit

Permalink
Null safety in destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Naktibalda committed Mar 5, 2022
1 parent cbc1954 commit 024505f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Driver/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function __construct(string $dsn, string $user = null, string $password =

public function __destruct()
{
if ($this->dbh->inTransaction()) {
if ($this->dbh !== null && $this->dbh->inTransaction()) {
$this->dbh->rollBack();
}

Expand Down

0 comments on commit 024505f

Please sign in to comment.