Fix warning in some chained dispatch cases
Tomas Doran [Sat, 26 May 2012 10:14:27 +0000 (11:14 +0100)]
Changes
lib/Catalyst/DispatchType/Chained.pm

diff --git a/Changes b/Changes
index c8f5e48..b8770fc 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,9 @@
 # This file documents the revision history for Perl extension Catalyst.
 
  Bug fixes:
+  - Fix warnings in some matching cases for Action methods with
+    Args(), when using Catalyst::DispatchType::Chained
+
   - Fix request body parameters to not be undef if no parameters
     are supplied.
 
index 3b7b0c4..5f72fba 100644 (file)
@@ -253,7 +253,7 @@ sub recurse_match {
 
                 if (!$best_action                       ||
                     @parts < @{$best_action->{parts}}   ||
-                    (!@parts && $args_attr eq 0)){
+                    (!@parts && defined($args_attr) && $args_attr eq "0")){
                     $best_action = {
                         actions => [ $action ],
                         captures=> [],