From c53187a7cd141a33b4b0a2b9b837fc2c15fc6b03 Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Tue, 21 Jun 2011 11:44:10 -0400 Subject: [PATCH] MFHD compressed holdings short-circuit logic If you attempt to get compressed (or uncompressed) holdings from a MFHD record with only a caption, the code should short-circuit and return an empty list. Signed-off-by: Dan Wells Signed-off-by: Dan Scott --- Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm index 48f00cb1a7..5b728c039d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm @@ -357,6 +357,8 @@ sub get_compressed_holdings { @decomp_holdings = $self->get_decompressed_holdings($caption, {'dedupe' => 1}); } + return () if !@decomp_holdings; + my $runner = $decomp_holdings[0]->clone->increment; my $curr_holding = shift(@decomp_holdings); $curr_holding = $curr_holding->clone; @@ -414,6 +416,9 @@ sub get_decompressed_holdings { my $link_id = $caption->link_id; $htag =~ s/^85/86/; my @holdings = $self->holdings($htag, $link_id); + + return () if !@holdings; + my @decomp_holdings; foreach my $holding (@holdings) { -- 2.43.2