diff --git a/src/Codeception/Lib/Driver/Db.php b/src/Codeception/Lib/Driver/Db.php index b69017ef..fdcdb4e4 100755 --- a/src/Codeception/Lib/Driver/Db.php +++ b/src/Codeception/Lib/Driver/Db.php @@ -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(); }