Squelch uninitialized var warning from hold_copy_targeter
authorBill Erickson <berick@esilibrary.com>
Mon, 16 Jul 2012 20:56:10 +0000 (16:56 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 17 Jul 2012 14:42:53 +0000 (10:42 -0400)
open-ils.storage_stderr.log was getting filled with entries like:

"Use of uninitialized value in concatenation (.) or string at
/usr/local/share/perl/5.10.1/OpenILS/Application/Storage/Publisher/action.pm"

... consuming disk space endlessly. Stop that!

(Stealing Lebbeous' footwork and providing a slightly different solution.)

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm

index 7c07e6f..ada8dc4 100644 (file)
@@ -1285,7 +1285,7 @@ sub new_hold_copy_targeter {
                        my @good_copies;
                        for my $c (@$all_copies) {
                                # current target
-                               next if ($c->id eq $hold->current_copy);
+                               next if ($hold->current_copy and $c->id eq $hold->current_copy);
 
                                # skip on circ lib is closed IFF we care
                                my $ignore_closing;