Skip to content

Commit 031ed45

Browse files
RaazPusparap2hpoutre
authored andcommitted
Handle empty log array while preparing data to display (#214)
PHP 7.4 throws an error while trying to access array offset on value of type bool returned by reset() method for empty log
1 parent 5957eb0 commit 031ed45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/controllers/LogViewerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function index()
7272
return $data;
7373
}
7474

75-
if (is_array($data['logs'])) {
75+
if (is_array($data['logs']) && count($data['logs']) > 0) {
7676
$firstLog = reset($data['logs']);
7777
if (!$firstLog['context'] && !$firstLog['level']) {
7878
$data['standardFormat'] = false;

0 commit comments

Comments
 (0)