Bug 15023: (followup) Remove warnings
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Jun 2016 15:24:15 +0000 (12:24 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 24 Aug 2016 11:37:02 +0000 (11:37 +0000)
By setting 'use Modern::Perl' some previously hidden warnings arised.
This patch removes them by testing the variable $balance for undef
before using it in a comparisson.

Sponsored-by: VOKAL
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
tools/cleanborrowers.pl

index df2196f..4cc9169 100755 (executable)
@@ -188,7 +188,7 @@ sub _skip_borrowers_with_nonzero_balance {
     my $balance;
     @$borrowers = map {
         (undef, undef, $balance) = GetMemberIssuesAndFines( $_->{borrowernumber} );
-        ($balance != 0) ? (): ($_);
+        (defined $balance && $balance != 0) ? (): ($_);
     } @$borrowers;
 }