Skip to content

Commit b480bf1

Browse files
committed
fix: fixes #131 yiilogger may not be initialized in _failed
1 parent 956c3bb commit b480bf1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Codeception/Module/Yii2.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@ public function _after(TestInterface $test): void
460460
*/
461461
public function _failed(TestInterface $test, $fail): void
462462
{
463-
$log = $this->yiiLogger->getAndClearLog();
464-
if ($log !== '') {
463+
$log = $this->yiiLogger?->getAndClearLog();
464+
if (isset($log) && $log !== '') {
465465
$test->getMetadata()->addReport('yii-log', $log);
466466
}
467467

0 commit comments

Comments
 (0)