Added support for non C::Base components to live in MyApp namespace
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index 32ccd67..33d497f 100644 (file)
@@ -144,6 +144,13 @@ sub forward {
             $c->log->debug($error) if $c->debug;
             return 0;
         }
+        
+        unless ( UNIVERSAL::isa( $class, 'Catalyst::Base' ) ) {
+            my $error = qq/Can't forward to "$class". Class is not a Catalyst component./;
+            $c->error($error);
+            $c->log->debug($error) if $c->debug;
+            return 0;            
+        }
 
         my $method = shift || 'process';