Fixed uninitialized value warning in contextual_uri_for branch Chained
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Chained.pm
index 296a873..d34545c 100644 (file)
@@ -405,7 +405,6 @@ Calculates the number of capture args for the given action,
 splices off the front of the supplied args, and pushes them back
 on the args list wrapped in an array ref
 
-
 =cut
 
 sub splice_captures_from {
@@ -433,7 +432,8 @@ sub splice_captures_from {
         push @captures, splice @{ $args }, 0, $num_caps;
     }
 
-    if (defined $args->[ $attrs->{Args}->[0] ]) {
+    if (    defined $attrs->{Args}->[0]
+        and defined $args->[ $attrs->{Args}->[0] ]) {
         $c->log->debug( 'Action '.$action->reverse.' too many args' )
             if ($c->debug);
     }