Skip to content

Commit a7f7440

Browse files
committed
Check for existing files before retrieving modified time
1 parent ebbfd0e commit a7f7440

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/LogFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ public function getLastScannedFilePositionForQuery(?string $query = ''): ?int
104104
public function earliestTimestamp(): int
105105
{
106106
return $this->getMetadata('earliest_timestamp')
107-
?? LogViewer::getFilesystem()->lastModified($this->path);
107+
?? LogViewer::getFilesystem()->exists($this->path) ? LogViewer::getFilesystem()->lastModified($this->path) : 0;
108108
}
109109

110110
public function latestTimestamp(): int
111111
{
112112
return $this->getMetadata('latest_timestamp')
113-
?? LogViewer::getFilesystem()->lastModified($this->path);
113+
?? LogViewer::getFilesystem()->exists($this->path) ? LogViewer::getFilesystem()->lastModified($this->path) : 0;
114114
}
115115

116116
public function scan(int $maxBytesToScan = null, bool $force = false): void

0 commit comments

Comments
 (0)