From: Robert Sedlacek Date: Thu, 1 Jun 2006 15:16:18 +0000 (+0000) Subject: Test if value is blessed before ->isa X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9eb328922da470ed2053fdf8369f986e842fc226;p=dbsrgits%2FDBIx-Class-Historic.git Test if value is blessed before ->isa --- diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index 0401c0a..3396af1 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -3,6 +3,7 @@ package DBIx::Class::Relationship::Base; use strict; use warnings; +use Scalar::Util (); use base qw/DBIx::Class/; =head1 NAME @@ -339,7 +340,7 @@ sub set_from_related { if (defined $f_obj) { my $f_class = $self->result_source->schema->class($rel_obj->{class}); $self->throw_exception( "Object $f_obj isn't a ".$f_class ) - unless $f_obj->isa($f_class); + unless Scalar::Util::blessed($f_obj) and $f_obj->isa($f_class); } $self->set_columns( $self->result_source->resolve_condition(