From: dbs Date: Fri, 22 May 2009 14:18:08 +0000 (+0000) Subject: Protect against the horrifying possibility that a caption might not exist X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fc69f0168ffae5356bc344d4cf0f17fdafab53c3;p=evergreen%2Fbjwebb.git Protect against the horrifying possibility that a caption might not exist git-svn-id: svn://svn.open-ils.org/ILS/trunk@13215 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Holding.pm b/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Holding.pm index c821a672b..1c2048538 100755 --- a/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Holding.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Holding.pm @@ -28,7 +28,7 @@ sub new { foreach my $subfield ($self->subfields) { my ($key, $val) = @$subfield; - if (($caption->enumeration_is_chronology && $key =~ /[a-h]/) || $key =~ /[i-m]/) { + if (($caption && $caption->enumeration_is_chronology && $key =~ /[a-h]/) || $key =~ /[i-m]/) { # Chronology $self->{_mfhdh_SUBFIELDS}->{$key} = $val; } elsif ($key =~ /[a-h]/) { @@ -238,7 +238,7 @@ sub validate { my $self = shift; foreach my $key (keys %{$self->{_mfhdh_SUBFIELDS}}) { - if (!$self->{_mfhdh_CAPTION}->capfield($key)) { + if (!($self->{_mfhdh_CAPTION}) && $self->{_mfhdh_CAPTION}->capfield($key)) { return 0; } }