From: Sebastian Riedel Date: Sun, 3 Apr 2005 18:44:39 +0000 (+0000) Subject: second try X-Git-Tag: 5.7099_04~1611 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=f6e054bb531b18cbe6c7826efdbf804a87e4858f second try --- diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 13fcdc0..733e1ea 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -388,6 +388,7 @@ Get an action in a given namespace. sub get_action { my ( $c, $action, $namespace ) = @_; + return [] unless $action; $namespace ||= ''; if ($namespace) { $namespace = '' if $namespace eq '/'; @@ -459,11 +460,13 @@ sub handler { for my $begin ( @{ $c->get_action( 'begin', $namespace ) } ) { $c->state( $c->execute( @{ $begin->[0] } ) ); } - for my $result ( - @{ $c->get_action( $c->req->action, $default ) }[-1] ) - { - $c->state( $c->execute( @{ $result->[0] } ) ); - last unless $default; + if ( my $action = $c->req->action ) { + for my $result ( + @{ $c->get_action( $action, $default ) }[-1] ) + { + $c->state( $c->execute( @{ $result->[0] } ) ); + last unless $default; + } } for my $end ( reverse @{ $c->get_action( 'end', $namespace ) } ) {