Fix to search_realted on relationships without attrs from ningu
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Relationship.pm
index fc48fdc..04bb4b3 100644 (file)
@@ -70,7 +70,7 @@ sub search_related {
   }
   my $rel_obj = $self->_relationships->{$rel};
   die "No such relationship ${rel}" unless $rel;
-  $attrs = { %{$rel_obj->{attrs}}, %{$attrs || {}} };
+  $attrs = { %{$rel_obj->{attrs} || {}}, %{$attrs || {}} };
   my $s_cond;
   if (@_) {
     die "Invalid query: @_" if (@_ > 1 && (@_ % 2 == 1));