only call ACCEPT_CONTEXT if we actually have a context
Guillermo Roditi [Tue, 2 Sep 2008 23:54:43 +0000 (23:54 +0000)]
lib/Catalyst.pm

index 8eb5838..b0d30d7 100644 (file)
@@ -506,7 +506,7 @@ sub _comp_names {
 sub _filter_component {
     my ( $c, $comp, @args ) = @_;
 
-    if ( eval { $comp->can('ACCEPT_CONTEXT'); } ) {
+    if ( Scalar::Util::blessed($c) && eval { $comp->can('ACCEPT_CONTEXT'); } ) {
         return $comp->ACCEPT_CONTEXT( $c, @args );
     }