From: Gareth Kirwan Date: Fri, 7 Aug 2009 16:45:03 +0000 (+0000) Subject: DispatchType::Chained fix for default args attribute to handle Args(0) vs Args()... X-Git-Tag: 5.80008~35 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=f4fba3d7cf527e80b293f46c1830f77e557bf6d2 DispatchType::Chained fix for default args attribute to handle Args(0) vs Args() at depth. --- diff --git a/lib/Catalyst/DispatchType/Chained.pm b/lib/Catalyst/DispatchType/Chained.pm index 890961d..3495749 100644 --- a/lib/Catalyst/DispatchType/Chained.pm +++ b/lib/Catalyst/DispatchType/Chained.pm @@ -233,7 +233,9 @@ sub recurse_match { local $c->req->{arguments} = [ @{$c->req->args}, @parts ]; next TRY_ACTION unless $action->match($c); } - my $args_attr = $action->attributes->{Args}->[0]; + + # Default args is blank, not 0, since Args() + my $args_attr = $action->attributes->{Args}->[0] || ''; # No best action currently # OR This one matches with fewer parts left than the current best action,