compatible with 0.08012
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / lib / DBIx / Class / ResultSet / RecursiveUpdate.pm
index 1c408252dff1cbaef14d3d587224963634d7ceda..880c0c2744a6bf748070720b55ae59fa872531f3 100644 (file)
@@ -132,17 +132,17 @@ sub _update_relation {
 
  #                    warn 'resolved: ' . Dumper( $resolved ); use Data::Dumper;
     $resolved = undef
-      if $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION == $resolved;
+      if defined $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION && $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION == $resolved;
     if ( ref $updates->{$name} eq 'ARRAY' ) {
         for my $sub_updates ( @{ $updates->{$name} } ) {
-            $sub_updates = { %$sub_updates, %$resolved } if $resolved;
+            $sub_updates = { %$sub_updates, %$resolved } if $resolved && ref( $sub_updates ) eq 'HASH';
             my $sub_object =
               $related_result->recursive_update( $sub_updates );
         }
     }
     else {
         my $sub_updates = $updates->{$name};
-        $sub_updates = { %$sub_updates, %$resolved } if $resolved;
+        $sub_updates = { %$sub_updates, %$resolved } if $resolved && ref( $sub_updates ) eq 'HASH';
         my $sub_object =
           $related_result->recursive_update( $sub_updates );
         $object->set_from_related( $name, $sub_object );
This page took 0.016256 seconds and 4 git commands to generate.