Bug 12861: (follow-up) Noisy warn in error logs
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 15 Jan 2015 14:20:02 +0000 (15:20 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 21 Jan 2015 13:47:47 +0000 (10:47 -0300)
Completely get rid of warns.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/AuthoritiesMarc.pm

index a779cbc..34151fc 100644 (file)
@@ -169,18 +169,19 @@ sub SearchAuthorities {
                 $attr = " \@attr 1=Any ";
             }
 
-            if ( @$operator[$i] eq 'is' ) {
+            my $operator = @$operator[$i];
+            if ( $operator and $operator eq 'is' ) {
                 $attr .= " \@attr 4=1  \@attr 5=100 "
                   ;    ##Phrase, No truncation,all of subfield field must match
             }
-            elsif ( @$operator[$i] eq "=" ) {
+            elsif ( $operator and $operator eq "=" ) {
                 $attr .= " \@attr 4=107 ";    #Number Exact match
             }
-            elsif ( @$operator[$i] eq "start" ) {
+            elsif ( $operator and $operator eq "start" ) {
                 $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 "
                   ;    #Firstinfield Phrase, Right truncated
             }
-            elsif ( @$operator[$i] eq "exact" ) {
+            elsif ( $operator and $operator eq "exact" ) {
                 $attr .= " \@attr 4=1  \@attr 5=100 \@attr 6=3 "
                   ;    ##Phrase, No truncation,all of subfield field must match
             }