can(undef) on 5.8.x blows up, work around it
[catagits/Web-Simple.git] / lib / Web / Dispatch.pm
index d34fe6e..a9df54c 100644 (file)
@@ -128,7 +128,7 @@ sub _to_try {
     }
   } elsif (!ref($try)
     and (ref($more->[0]) eq 'CODE'
-      or (!ref($more->[0]) and $self->dispatch_object
+      or ($more->[0] and !ref($more->[0]) and $self->dispatch_object
         and $self->dispatch_object->can($more->[0])))
   ) {
     $self->_construct_node(match => $try, run => shift(@$more));