mirror of
https://github.com/flarum/core.git
synced 2025-07-21 00:31:17 +02:00
Only delete avatar if it exists
This commit is contained in:
@@ -51,7 +51,9 @@ class DeleteAvatarHandler
|
|||||||
|
|
||||||
event(new AvatarWillBeDeleted($user, $actor));
|
event(new AvatarWillBeDeleted($user, $actor));
|
||||||
|
|
||||||
$this->uploadDir->delete($avatarPath);
|
if ($this->uploadDir->has($avatarPath)) {
|
||||||
|
$this->uploadDir->delete($avatarPath);
|
||||||
|
}
|
||||||
|
|
||||||
$user->save();
|
$user->save();
|
||||||
$this->dispatchEventsFor($user);
|
$this->dispatchEventsFor($user);
|
||||||
|
Reference in New Issue
Block a user