From: Marcus Ramberg Date: Wed, 7 Dec 2005 16:15:10 +0000 (+0000) Subject: bugfix for $c->model and friends. X-Git-Tag: 5.7099_04~789 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=29f5acef992a393dcbd64bdc451047d9102eff94;hp=33117422d27c359a700390643e72f5382a19524e bugfix for $c->model and friends. --- diff --git a/Changes b/Changes index 5d15789..d00a42f 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,7 @@ This file documents the revision history for Perl extension Catalyst. - Added REDIRECT_URL support for applications running behind a RewriteRule in Apache. (Carl Franks) - Fixed FastCGI engine under win32. (Carl Franks) + - Bugfix for $c->model and friends (defined). 5.61 2005-12-02 00:00:00 - Fixed ExtUtils::AutoInstall Bootstrap Code in Makefile.PL diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 0553622..7b56a60 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -388,7 +388,7 @@ Gets a L instance by name. sub controller { my ( $c, $name ) = @_; my $controller = $c->comp("Controller::$name"); - return $controller if $controller; + return $controller if defined $controller; return $c->comp("C::$name"); } @@ -403,7 +403,7 @@ Gets a L instance by name. sub model { my ( $c, $name ) = @_; my $model = $c->comp("Model::$name"); - return $model if $model; + return $model if defined $model; return $c->comp("M::$name"); } @@ -418,7 +418,7 @@ Gets a L instance by name. sub view { my ( $c, $name ) = @_; my $view = $c->comp("View::$name"); - return $view if $view; + return $view if defined $view; return $c->comp("V::$name"); }