From: Simon Cozens Date: Thu, 26 Feb 2004 15:07:24 +0000 (+0000) Subject: Belt and braces. X-Git-Tag: 2.10~284 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=6d2982560f68030ec5153d40e444575745640688;p=maypole.git Belt and braces. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@78 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Model/CDBI.pm b/lib/Maypole/Model/CDBI.pm index c7621d2..34aa741 100644 --- a/lib/Maypole/Model/CDBI.pm +++ b/lib/Maypole/Model/CDBI.pm @@ -35,7 +35,7 @@ sub related { sub do_edit :Exported { my ($self, $r) = @_; my $h = CGI::Untaint->new(%{$r->{params}}); - my ($obj) = @{$r->objects}; + my ($obj) = @{$r->objects || []}; if ($obj) { # We have something to edit $obj->update_from_cgi($h); @@ -57,7 +57,7 @@ sub do_edit :Exported { sub delete :Exported { my ($self, $r) = @_; - $_->SUPER::delete for @{ $r->objects }; + $_->SUPER::delete for @{ $r->objects || [] }; $r->objects([ $self->retrieve_all ]); $r->{template} = "list"; }