Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/MGRAST/lib/resources/metagenome.pm
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ sub query {
}
my $obj = $self->check_pagination($data, $total, $limit);
$obj->{version} = 1;

# found nothing, return it
if (scalar(@$data) == 0) {
$self->return_data($obj);
}

if (($verb eq 'minimal') || ($verb eq 'mixs')) {
# add missing fields to solr data
Expand Down
5 changes: 0 additions & 5 deletions src/MGRAST/lib/resources/resource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,6 @@ sub check_pagination {
$limit = int($limit);
$path = $path || "";

# user asked for to large of an offset
if ($offset >= $total) {
$self->return_data({"ERROR" => "Requested offset ($offset) is greater than availabale objects ($total)."}, 404);
}

my $total_count = $total || scalar(@$data);
my $prev_offset = (($offset - $limit) < 0) ? 0 : $offset - $limit;
my $next_offset = $offset + $limit;
Expand Down