fixed end inheritance
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine.pm
index ec4842b..b477b4c 100644 (file)
@@ -314,7 +314,10 @@ sub get_action {
             my $child = $visitor->getResult;
             my $uid   = $child->getUID if $child;
             my $match = $c->actions->{private}->{$uid}->{$action} if $uid;
-            push @results, [$match] if $match;
+            if ($match) {
+                $action eq 'end' ? unshift @results, [$match] : push @results,
+                  [$match];
+            }
             $parent = $child if $child;
         }
         return \@results;