LibreCat / Catmandu

Catmandu - a data processing toolkit

Home Page:https://librecat.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Catmandu::Paged : "illegal division by zero" when limit is 0

nicolasfranck opened this issue · comments

my $hits = Catmandu::Hits->new( start => 0, limit => 0, hits => [], total => 100 );
say $hits->page;

returns:

Runtime error: Illegal division by zero at /Users/njfranck/.plenv/versions/5.22.0/lib/perl5/site_perl/5.22.0/Catmandu/Paged.pm

This happens when you call $hits->page or $hits->last_page.

I can't reproduce this with the latest Catmandu (1.2013).

You're right, I only tried out your example, which doesn't die.

@nics nice ;-)