diff --git a/lib/PostText/Controller/Remark.pm b/lib/PostText/Controller/Remark.pm index 8ec9a1d..c813802 100644 --- a/lib/PostText/Controller/Remark.pm +++ b/lib/PostText/Controller/Remark.pm @@ -57,6 +57,9 @@ sub create($self) { last_remark => $last_remark ); + $self->stash(status => 404, error => 'Thread not found 🤷') + unless keys %{$thread}; + return $self->render; } diff --git a/templates/remark/create.html.ep b/templates/remark/create.html.ep index 76f4a89..d66b78d 100644 --- a/templates/remark/create.html.ep +++ b/templates/remark/create.html.ep @@ -1,6 +1,7 @@ % layout 'default'; % title 'New Remark';