diff --git a/src/PlatesLocalAssetsCopy.php b/src/PlatesLocalAssetsCopy.php index acb4e31..700678d 100644 --- a/src/PlatesLocalAssetsCopy.php +++ b/src/PlatesLocalAssetsCopy.php @@ -63,9 +63,9 @@ public function getLocalCached(string $url): string { $filename = basename($url); $cacheFile = $this->cachePath . '/' . $filename; - $filemtime = filemtime($cacheFile); + $filemtime = file_exists($cacheFile) ? filemtime($cacheFile) : false; - if (!file_exists($cacheFile) || $filemtime < $this->cacheDeadline) { + if (!$filemtime || $filemtime < $this->cacheDeadline) { $this->downloader->download($url); if ($this->downloader->getStatusCode() !== 200) {