Skip to content

Commit 209bbc9

Browse files
author
Bradie Tilley
committed
Fix exception when directory doesn't exist during cache clear
1 parent 88c1b9f commit 209bbc9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

classes/Resizer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,11 @@ public static function clearFiles(Carbon $minAge = null, string $directory = nul
10511051
{
10521052
$directory = $directory ?? Settings::getBasePath();
10531053

1054+
// Skip if the directory doesn't exist
1055+
if (!is_dir($directory)) {
1056+
return 0;
1057+
}
1058+
10541059
$files = collect(File::allFiles($directory))
10551060
->transform(function ($file) use ($minAge) {
10561061
$delete = true;

updates/version.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@
5151
2.2.2:
5252
- Fix MySQL issue where text fields had default values
5353
2.2.3:
54-
- Improvements to Permalinks
54+
- Improvements to Permalinks
55+
2.2.4:
56+
- Fix exception when directory doesn't exist during cache clear

0 commit comments

Comments
 (0)