From: Peter Rabbitson Date: Wed, 3 Feb 2016 00:30:36 +0000 (+0100) Subject: Remove gratuituous use of eval X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dff896024ddd0fcf16d797811be2a3540eb5a695;p=dbsrgits%2FDBIx-Class-Historic.git Remove gratuituous use of eval --- diff --git a/lib/DBIx/Class/CDBICompat/Relationships.pm b/lib/DBIx/Class/CDBICompat/Relationships.pm index 05afe74..8d923b3 100644 --- a/lib/DBIx/Class/CDBICompat/Relationships.pm +++ b/lib/DBIx/Class/CDBICompat/Relationships.pm @@ -7,6 +7,7 @@ use base 'Class::Data::Inheritable'; use Clone; use DBIx::Class::CDBICompat::Relationship; +use Scalar::Util 'blessed'; use DBIx::Class::_Util qw(quote_sub perlstring); __PACKAGE__->mk_classdata('__meta_info' => {}); @@ -200,8 +201,11 @@ sub search { : undef()); if (ref $where eq 'HASH') { foreach my $key (keys %$where) { # has_a deflation hack - $where->{$key} = ''.$where->{$key} - if eval { $where->{$key}->isa('DBIx::Class') }; + $where->{$key} = ''.$where->{$key} if ( + defined blessed $where->{$key} + and + $where->{$key}->isa('DBIx::Class') + ); } } $self->next::method($where, $attrs);