Skip to content

Commit a599b5c

Browse files
SilverFiresamdark
authored andcommitted
Prevent NPE in Yii2 module (#5136)
1 parent 935d4ba commit a599b5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Codeception/Module/Yii2.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,11 @@ public function _after(TestInterface $test)
343343

344344
$this->rollbackTransactions();
345345

346-
$this->connectionWatcher->stop();
347-
$this->connectionWatcher->closeAll();
348-
unset($this->connectionWatcher);
346+
if (isset($this->connectionWatcher)) {
347+
$this->connectionWatcher->stop();
348+
$this->connectionWatcher->closeAll();
349+
unset($this->connectionWatcher);
350+
}
349351

350352
if ($this->config['cleanup']) {
351353
foreach ($this->loadedFixtures as $fixture) {

0 commit comments

Comments
 (0)