X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FChained.pm;h=95d6559836b9c67696c6ed60ec7aab96072fcb40;hp=3b7502e95dceb08d61522d3d02be63d9b21ea3d7;hb=13c6b4cc50b9235536022e4deb470c151d9b7fac;hpb=4fbc0e853c0b29d1f6082909b0cb54595ea32787 diff --git a/lib/Catalyst/DispatchType/Chained.pm b/lib/Catalyst/DispatchType/Chained.pm index 3b7502e..95d6559 100644 --- a/lib/Catalyst/DispatchType/Chained.pm +++ b/lib/Catalyst/DispatchType/Chained.pm @@ -258,8 +258,13 @@ sub register { "Multiple Chained attributes not supported registering ${action}" ); } + my $chained_to = $chained_attr[0]; - my $children = ($self->_children_of->{ $chained_attr[0] } ||= {}); + Catalyst::Exception->throw( + "Actions cannot chain to themselves registering /${action}" + ) if ($chained_to eq '/' . $action); + + my $children = ($self->_children_of->{ $chained_to } ||= {}); my @path_part = @{ $action->attributes->{PathPart} || [] };