From a14ebfef6649c4bedef194b40e998cc294b2f706 Mon Sep 17 00:00:00 2001 From: Mickey Nasriachi Date: Tue, 11 Jul 2017 12:19:13 +0100 Subject: [PATCH] Favorite model: check input args before URL concat This will fix some log warnings. --- lib/MetaCPAN/Web/Model/API/Favorite.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/MetaCPAN/Web/Model/API/Favorite.pm b/lib/MetaCPAN/Web/Model/API/Favorite.pm index f06d0a6bd3..a78071a96e 100644 --- a/lib/MetaCPAN/Web/Model/API/Favorite.pm +++ b/lib/MetaCPAN/Web/Model/API/Favorite.pm @@ -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 } ) @@ -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(