Skip to content

Commit 239e2eb

Browse files
authored
Check if file exists on FilesystemStorage (#1790)
1 parent 0cd8c86 commit 239e2eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Storage/FilesystemStorage.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ protected function garbageCollect()
8181
*/
8282
public function get($id)
8383
{
84-
return json_decode($this->files->get($this->makeFilename($id)), true);
84+
$fileName = $this->makeFilename($id);
85+
if (!$this->files->exists($fileName)) {
86+
return [];
87+
}
88+
89+
return json_decode($this->files->get($fileName), true);
8590
}
8691

8792
/**

0 commit comments

Comments
 (0)