Merge branch '104-path_empty_brackets' of https://github.com/grim8634/catalyst-runtim...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Action.pm
index 3497e21..ea3e3e4 100644 (file)
@@ -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