From: Michael G Schwern Date: Wed, 12 Mar 2008 21:29:58 +0000 (+0000) Subject: Fix lazy loading when the object has been deleted X-Git-Tag: v0.08240~532 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4d970edd7f7fe71787d2b7ca754980fd92727cb;p=dbsrgits%2FDBIx-Class.git Fix lazy loading when the object has been deleted --- diff --git a/lib/DBIx/Class/CDBICompat/LazyLoading.pm b/lib/DBIx/Class/CDBICompat/LazyLoading.pm index e8ffbcc..e07579a 100644 --- a/lib/DBIx/Class/CDBICompat/LazyLoading.pm +++ b/lib/DBIx/Class/CDBICompat/LazyLoading.pm @@ -103,7 +103,9 @@ sub _flesh { # $self->ident_condition); # Not sure why the first one works and this doesn't :( my @val = $cursor->next; -#warn "Flesh: ".join(', ', @want, '=>', @val); + + return unless @val; # object must have been deleted from the database + foreach my $w (@want) { $self->{'_column_data'}{$w} = shift @val; }