Check if user exists before checking redirect

This commit is contained in:
Josef Citrine 2017-09-28 23:18:38 +01:00
parent 4dd8e4f038
commit 1f46b3a85d

View file

@ -46,6 +46,7 @@ class ArtistsController extends Controller
{
$user = User::whereSlug($slug)->first();
if ($user) {
if ($user->redirect_to) {
$newUser = User::find($user->redirect_to);
@ -59,6 +60,9 @@ class ArtistsController extends Controller
}
return View::make('artists.profile');
} else {
App::abort('404');
}
}
public function getShortlink($id)