go() cannot dispatch to anon. actions, fix code and tests to match.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index 8028712..262301a 100644 (file)
@@ -114,7 +114,6 @@ message about unknown resource
 sub dispatch {
     my ( $self, $c ) = @_;
     if ( $c->action ) {
-use Data::Dumper; warn Dumper( $c->action, $c->action->namespace );
         $c->forward( join( '/', '', $c->action->namespace, '_DISPATCH' ) );
     }
 
@@ -177,7 +176,7 @@ sub go {
     my ( $c, $command ) = @_;
     my ( $action, $args ) = $self->_command2action(@_);
 
-    unless ($action) {
+    unless ($action && defined $action->namespace) {
         my $error =
             qq/Couldn't go to command "$command": /
           . qq/Invalid action or component./;