X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FAction.pm;fp=lib%2FCatalyst%2FAction.pm;h=07f2f32dbf01f7502027e13ca30ae34d08384188;hp=fef451dc9eaf3952c3e88f82f317105cc0a3428a;hb=43b44b3a2ee087f00af6579d3b6ac63f8f645412;hpb=dd6a9f23fda9c6520be5021f7fb51f4fb345c8c4 diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index fef451d..07f2f32 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -52,7 +52,9 @@ has number_of_args => ( if( ! exists $self->attributes->{Args} ) { # When 'Args' does not exist, that means we want 'any number of args'. return undef; - } elsif(!defined($self->attributes->{Args}[0])) { + } elsif( + !defined($self->attributes->{Args}[0]) || + $self->attributes->{Args}[0] eq '' ) { # When its 'Args' that internal cue for 'unlimited' return undef; } elsif( @@ -138,6 +140,7 @@ has args_constraints => ( return [] unless scalar(@arg_protos); return [] unless defined($arg_protos[0]); + return [] if ($arg_protos[0] eq '' && scalar(@arg_protos) == 1); # If there is only one arg and it looks like a number # we assume its 'classic' and the number is the number of