Skip to content

Commit

Permalink
Favorite model: check input args before URL concat
Browse files Browse the repository at this point in the history
This will fix some log warnings.
  • Loading branch information
mickeyn committed Jul 11, 2017
1 parent 8ccb288 commit 31a9d12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/MetaCPAN/Web/Model/API/Favorite.pm
Expand Up @@ -23,6 +23,7 @@ sub get {

sub by_user {
my ( $self, $user, $size ) = @_;
return Future->done unless $user;
$size ||= 250;
my $ret
= $self->request( "/favorite/by_user/$user", { size => $size } )
Expand Down Expand Up @@ -73,6 +74,7 @@ sub leaderboard {

sub find_plussers {
my ( $self, $distribution ) = @_;
return Future->done unless $distribution;

# search for all users, match all according to the distribution.
$self->request("/favorite/users_by_distribution/$distribution")->then(
Expand Down

0 comments on commit 31a9d12

Please sign in to comment.