mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 07:03:35 +08:00
Only delete avatar if it exists
This commit is contained in:
parent
f67b7fda6a
commit
5f23e8c447
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user