Skip to content

Commit 12792ce

Browse files
authored
Merge pull request #375 from fsbruva/master
(bugfix): Protect LogIterator.php from empty array indices
2 parents ebca71d + ce26d1d commit 12792ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/Log/LogIterator.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ function rewind() {
7575
function current() {
7676
$entry = json_decode($this->lastLine, true);
7777
if ($this->dateFormat !== \DateTime::ATOM) {
78-
$time = \DateTime::createFromFormat($this->dateFormat, $entry['time'], $this->timezone);
79-
if ($time) {
80-
$entry['time'] = $time->format(\DateTime::ATOM);
78+
if (isset($entry['time'])) {
79+
$time = \DateTime::createFromFormat($this->dateFormat, $entry['time'], $this->timezone);
80+
if ($time) {
81+
$entry['time'] = $time->format(\DateTime::ATOM);
82+
}
8183
}
8284
}
8385
return $entry;

0 commit comments

Comments
 (0)