mirror of
https://github.com/flarum/framework.git
synced 2024-12-05 00:43:39 +08:00
Don't attempt deletion if the user doesn't have an avatar
This commit is contained in:
parent
8abaef5884
commit
281f014eaa
|
@ -51,7 +51,7 @@ class UploadAvatarCommandHandler
|
|||
'target' => $this->uploadDir,
|
||||
]);
|
||||
|
||||
if ($mount->has($file = "target://$user->avatar_path")) {
|
||||
if ($user->avatar_path && $mount->has($file = "target://$user->avatar_path")) {
|
||||
$mount->delete($file);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user