Skip to content

Commit

Permalink
Silence a warning that happens when a user possibly has a cookie but …
Browse files Browse the repository at this point in the history
…is not logged in.
  • Loading branch information
oalders committed Nov 19, 2016
1 parent 6ab87ab commit e2eaa8d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/MetaCPAN/Web/Controller/Account/Favorite.pm
Expand Up @@ -8,6 +8,13 @@ sub auto : Private {

# Needed to clear the cache
my $user = $c->model('API::User')->get_profile( $c->token )->recv;

# Probably we shouldn't be getting to this point without a defined user,
# but sometimes we do. Might have been an issue with the v0 => v1
# migration.

$c->detach('/forbidden') unless $user;

$c->stash->{user} = $user;

return 1;
Expand Down

0 comments on commit e2eaa8d

Please sign in to comment.