X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2Fcatbook-code.git;a=blobdiff_plain;f=lib%2FLolCatalyst%2FLite%2FController%2FTranslate.pm;fp=lib%2FLolCatalyst%2FLite%2FController%2FTranslate.pm;h=b9f7eb11c4694a5f6448aa7833a301ad69d5d87a;hp=749b3acc0571b6f25962c8c04e6ed65fd443f0bd;hb=e639dea98fb69c9382b0823026d8a62111d3053b;hpb=bab4d401f03e888505bb316de80e40cc79171283 diff --git a/lib/LolCatalyst/Lite/Controller/Translate.pm b/lib/LolCatalyst/Lite/Controller/Translate.pm index 749b3ac..b9f7eb1 100644 --- a/lib/LolCatalyst/Lite/Controller/Translate.pm +++ b/lib/LolCatalyst/Lite/Controller/Translate.pm @@ -37,6 +37,9 @@ sub view :Chained('object') :PathPart('') :Args(0) { sub translate_to :Chained('object') :PathPart('to') :Args(1) { my ($self, $c, $to) = @_; my $object = $c->stash->{object}; + unless ($object->can_translate_to($to)) { + $c->detach('/error_404'); + } $c->stash( result => $object->translated_to($to) );