mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 11:31:27 +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…
x
Reference in New Issue
Block a user