only call ACCEPT_CONTEXT if we actually have a context
[catagits/Catalyst-Runtime.git] / 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 );
     }