1
0
mirror of https://github.com/flarum/core.git synced 2025-06-05 22:25:29 +02:00

Only delete avatar if it exists

This commit is contained in:
Toby Zerner 2015-08-17 16:06:51 +09:30
parent a32250884c
commit edccd10693

View File

@ -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);