From 9f7672f5703cc6b9722558e5ee310929800a2f4f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 4 Dec 2022 22:21:09 -0700 Subject: [PATCH] Update AvatarObserver, fix cloud delete bug by checking if cloud storage is enabled --- app/Observers/AvatarObserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Observers/AvatarObserver.php b/app/Observers/AvatarObserver.php index 987db3097..6c644099e 100644 --- a/app/Observers/AvatarObserver.php +++ b/app/Observers/AvatarObserver.php @@ -65,7 +65,7 @@ class AvatarObserver @unlink($path); } - if($avatar->cdn_url) { + if($avatar->cdn_url && config_cache('pixelfed.cloud_storage')) { $disk = Storage::disk(config('filesystems.cloud')); $base = Str::startsWith($avatar->media_path, 'cache/avatars/'); if($base && $disk->exists($avatar->media_path)) {