zap undefined value warning
Tara L Andrews [Fri, 3 Feb 2012 20:45:32 +0000 (21:45 +0100)]
lib/Text/Tradition/Collation/RelationshipStore.pm

index 93c4699..a74c890 100644 (file)
@@ -259,7 +259,9 @@ sub relationship_valid {
                # Check that linking the source and target in a relationship won't lead
                # to a path loop for any witness.  If they have the same rank then fine.
                return( 1, "ok" ) 
-                       if $c->reading( $source )->rank == $c->reading( $target )->rank;
+                       if $c->reading( $source )->has_rank
+                               && $c->reading( $target )->has_rank
+                               && $c->reading( $source )->rank == $c->reading( $target )->rank;
                
                # Otherwise, first make a lookup table of all the
                # readings related to either the source or the target.