Skip to content

Commit

Permalink
Fix exception when directory doesn't exist during cache clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradie Tilley committed Dec 21, 2020
1 parent 88c1b9f commit 209bbc9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions classes/Resizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,11 @@ public static function clearFiles(Carbon $minAge = null, string $directory = nul
{
$directory = $directory ?? Settings::getBasePath();

// Skip if the directory doesn't exist
if (!is_dir($directory)) {
return 0;
}

$files = collect(File::allFiles($directory))
->transform(function ($file) use ($minAge) {
$delete = true;
Expand Down
4 changes: 3 additions & 1 deletion updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@
2.2.2:
- Fix MySQL issue where text fields had default values
2.2.3:
- Improvements to Permalinks
- Improvements to Permalinks
2.2.4:
- Fix exception when directory doesn't exist during cache clear

0 comments on commit 209bbc9

Please sign in to comment.