Skip to content

Commit 99ce044

Browse files
committed
fix error when files directory does not exist
1 parent 5109f32 commit 99ce044

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Filesystem.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public function has(string $filename): bool
3535
*/
3636
public function getNamesWithDifferentExtension(string $fileName)
3737
{
38+
if(! file_exists($this->basePath)) {
39+
return [];
40+
}
41+
3842
$extension = pathinfo($fileName, PATHINFO_EXTENSION);
3943

4044
$baseName = substr($fileName, 0, strlen($fileName) - strlen($extension) - 1);

0 commit comments

Comments
 (0)