Skip to content

Commit

Permalink
Extract module from array if necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Apr 23, 2016
1 parent 6243fc0 commit e43b380
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/MetaCPAN/Web/Controller/Search.pm
Expand Up @@ -42,8 +42,9 @@ sub index : Path {
)
{
my $module = $model->first($query)->recv;
if ( $query eq $module ) {
$c->res->redirect("/pod/$module");
$module = $module->[0] if $module;
if ( $module && $module eq $query ) {
$c->res->redirect( '/pod/' . $module->[0] );
$c->detach;
}
else {
Expand Down

0 comments on commit e43b380

Please sign in to comment.