Skip to content

Commit b3a4a45

Browse files
committed
package: don't return invalid ref (stash can only take a hash)
1 parent 802e212 commit b3a4a45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/MetaCPAN/Query/Package.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ sub get_modules {
2828
}
2929
);
3030

31-
my $hits = $res->{hits}{hits};
32-
return [] unless @{$hits};
33-
return +{ modules => [ map { $_->{_source}{module_name} } @{$hits} ] };
31+
return unless $res->{hits}{total};
32+
return +{ modules =>
33+
[ map { $_->{_source}{module_name} } @{ $res->{hits}{hits} } ] };
3434
}
3535

3636
__PACKAGE__->meta->make_immutable;

0 commit comments

Comments
 (0)