From: Alexander Hartmaier Date: Tue, 22 Mar 2011 10:42:16 +0000 (+0100) Subject: die if Catalyst app object is missing in push_error and get_errors X-Git-Tag: 2.003002~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-DBIC-API.git;a=commitdiff_plain;h=a80eb0e8fb994dc05e4d7e2d54108ad1d7d670a4 die if Catalyst app object is missing in push_error and get_errors --- diff --git a/lib/Catalyst/Controller/DBIC/API.pm b/lib/Catalyst/Controller/DBIC/API.pm index de143e6..99e11b7 100644 --- a/lib/Catalyst/Controller/DBIC/API.pm +++ b/lib/Catalyst/Controller/DBIC/API.pm @@ -932,6 +932,8 @@ push_error stores an error message into the stash to be later retrieved by L{message}) { $error = $params->{message}; @@ -951,6 +953,8 @@ get_errors returns all of the errors stored in the stash sub get_errors { my ( $self, $c ) = @_; + die 'Catalyst app object missing' + unless defined $c; return $c->stash->{_dbic_crud_errors}; }