Fix Catalyst::Dispatcher to handle a subclassless / COMPONENT-less View
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index f63c1a7..7b21510 100644 (file)
@@ -320,9 +320,9 @@ sub _invoke_as_component {
     my ( $self, $c, $component_or_class, $method ) = @_;
 
     my $component = $self->_find_component($c, $component_or_class);
-    my $component_class = blessed $component || return 0;
+    my $component_class = blessed($component) || $component || return 0;
 
-    if (my $code = $component_class->can('action_for')) {
+    if ( blessed $component and my $code = $component_class->can('action_for') ) {
         my $possible_action = $component->$code($method);
         return $possible_action if $possible_action;
     }
@@ -588,8 +588,8 @@ sub _find_or_create_namespace_node {
 
 =head2 $self->setup_actions( $class, $context )
 
-Loads all of the preload dispatch types, registers their actions and then
-loads all of the postload dispatch types, and iterates over the tree of
+Loads all of the pre-load dispatch types, registers their actions and then
+loads all of the post-load dispatch types, and iterates over the tree of
 actions, displaying the debug information if appropriate.
 
 =cut
@@ -738,7 +738,7 @@ foreach my $public_method_name (qw/
             $package_hash{$class}++ || do {
                 warn("Class $class is calling the deprecated method\n"
                     . "  Catalyst::Dispatcher::$public_method_name,\n"
-                    . "  this will be removed in Catalyst 5.9X\n");
+                    . "  this will be removed in Catalyst 5.9\n");
             };
         });
     }