check for undefined values when mapping item to MARC

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Galen Charlton 2008-01-03 12:36:26 -06:00 committed by Joshua Ferraro
parent a91b10dd57
commit 526eafe4e1

View file

@ -775,7 +775,7 @@ sub _marc_from_item_hash {
# Tack on 'items.' prefix to column names so lookup from MARC frameworks will work
# Also, don't emit a subfield if the underlying field is blank.
my $mungeditem = { map { $item->{$_} ne '' ?
my $mungeditem = { map { (defined($item->{$_}) and $item->{$_} ne '') ?
(/^items\./ ? ($_ => $item->{$_}) : ("items.$_" => $item->{$_}))
: () } keys %{ $item } };