From 5f23e8c44784ec18f12b0a5db990ac27f6db23ab Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 17 Aug 2015 16:06:51 +0930 Subject: [PATCH] Only delete avatar if it exists --- .../core/src/Core/Users/Commands/DeleteAvatarHandler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/core/src/Core/Users/Commands/DeleteAvatarHandler.php b/framework/core/src/Core/Users/Commands/DeleteAvatarHandler.php index a06429572..0ab9f888b 100644 --- a/framework/core/src/Core/Users/Commands/DeleteAvatarHandler.php +++ b/framework/core/src/Core/Users/Commands/DeleteAvatarHandler.php @@ -51,7 +51,9 @@ class DeleteAvatarHandler event(new AvatarWillBeDeleted($user, $actor)); - $this->uploadDir->delete($avatarPath); + if ($this->uploadDir->has($avatarPath)) { + $this->uploadDir->delete($avatarPath); + } $user->save(); $this->dispatchEventsFor($user);