break the loop if there are no capturable copies at this proximity
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 26 Jul 2006 17:04:01 +0000 (17:04 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 26 Jul 2006 17:04:01 +0000 (17:04 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5111 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm

index 6abf846..33dd5cd 100644 (file)
@@ -1053,6 +1053,7 @@ sub choose_nearest_copy {
                                  request_lib => $hold->request_lib->to_fieldmapper,
                                }
                        )) {
+                               last unless(@capturable);
                                $rand = int(rand(scalar(@capturable)));
                                next;
                        }