bugfix for case where duplicated reading has no language set
Tara L Andrews [Sun, 19 Apr 2015 18:32:15 +0000 (20:32 +0200)]
base/lib/Text/Tradition/Collation.pm

index 70e471a..3957762 100644 (file)
@@ -744,8 +744,11 @@ sub duplicate_reading {
                                $args{$attr->name} = $which eq 'Array' 
                                        ? [ $r->$acc ] : { $r->$acc };
                        } 
-               } else {
-                       $args{$attr->name} = $r->$acc if $acc;
+               } elsif( $acc ) {
+                       my $attrval = $r->$acc;
+                       if( defined $attrval ) {
+                               $args{$attr->name} = $attrval;
+                       }
                }
        }
        # By definition the new reading will no longer be common.