lib/PublicInbox/View.pm | 2 +- t/psgi_v2.t | 2 ++ diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 89174296335ab594cfac100db4d87664d506afc4..c42654b68204c67f697278bedfba504850b8c889 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -1056,7 +1056,7 @@ sub dump_topics { my ($ctx) = @_; my $order = delete $ctx->{order}; # [ ds, subj1, subj2, subj3, ... ] - if (!@$order) { + unless ($order) { $ctx->{-html_tip} = '
[No topics in range]
'; return 404; } diff --git a/t/psgi_v2.t b/t/psgi_v2.t index 2c9387a496cb0d16b31019bf2297d12ecba3d834..c4f808695b000110d84d69605f5e6e42a2437d2e 100644 --- a/t/psgi_v2.t +++ b/t/psgi_v2.t @@ -250,6 +250,8 @@ my $new = $cb->(GET('/v2test/' . $links[1])); is($old->content, 'old', 'got expected old content'); is($new->content, 'new', 'got expected new content'); } + $res = $cb->(GET('/v2test/?t=1970'.'01'.'01'.'000000')); + is($res->code, 404, '404 for out-of-range t= param'); }); done_testing();