From c6e098ae0bacbf9db6f554e89ba8481e88afee1b Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 20 Apr 2018 13:55:50 +0200 Subject: [PATCH] Bug 19873: (QA follow-up) Prevent warnings "Use of uninitialized value $operands[X] in string ne" Signed-off-by: Julian Maurice Signed-off-by: Jonathan Druart (cherry picked from commit 268ba1d5ec7ef66790583c877d5641f007550ad2) Signed-off-by: Fridolin Somers --- C4/Search.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index cae3a1ca87..10973e3aba 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1532,7 +1532,7 @@ sub buildQuery { for ( my $i = 0 ; $i <= @operands ; $i++ ) { # COMBINE OPERANDS, INDEXES AND OPERATORS - if ( $operands[$i] ne '' ) { + if ( ($operands[$i] // '') ne '' ) { $operands[$i]=~s/^\s+//; # A flag to determine whether or not to add the index to the query @@ -1677,7 +1677,7 @@ sub buildQuery { query_desc => $query_desc, operator => ($operators[ $i - 1 ]) ? $operators[ $i - 1 ] : '', parsed_operand => $operand, - original_operand => ($operands[$i] ne '') ? $operands[$i] : '', + original_operand => $operands[$i] // '', index => $index, index_plus => $index_plus, indexes_set => $indexes_set, -- 2.39.5