Skip to content

Commit 13974da

Browse files
authored
Fix CacheMap when cache is corrupted
1 parent 41b1b24 commit 13974da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Helpers/CacheMap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public function __construct(FilesystemAdapter $disk, string $basePath)
3030
$this->basePath = $basePath;
3131
$this->filePath = $this->disk->path($this->basePath.'.basset');
3232

33-
if (File::exists($this->filePath)) {
34-
$this->map = json_decode(File::get($this->filePath), true);
33+
if (File::exists($this->filePath) && is_array($map = json_decode(File::get($this->filePath), true))) {
34+
$this->map = $map;
3535
}
3636
}
3737

0 commit comments

Comments
 (0)