Don't attempt deletion if the user doesn't have an avatar

This commit is contained in:
Toby Zerner 2015-05-07 16:54:26 +09:30
parent 8abaef5884
commit 281f014eaa

View File

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