diff --git a/PostText.pl b/PostText.pl index ac7cb0f..948b4d5 100755 --- a/PostText.pl +++ b/PostText.pl @@ -151,6 +151,9 @@ group { my $remarks = $c->remark->get_remarks_by_thread_id($thread_id, $this_page); + # Probably a better way to do this 404 stuff I reckon + + # Check for existence of thread if (my $thread_body = %$thread{'body'}) { $c->stash( thread => $thread, @@ -167,6 +170,9 @@ group { ) } + # Check for existance of remark page number + $c->stash(status => 404) unless $remarks->[0] || 1 >= $this_page; + $c->render(); }; }; diff --git a/README.md b/README.md index 9b9b141..ee64079 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,3 @@ Run the tests locally (against development environment) 1. Return the last remark with remark form 1. Marked some items for clean up with comments 1. Method names may need to be shortened -1. Probably throw a 404 if you request a remark page that doesn't exist