skip empty results of hash_filter
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 6 Jul 2006 11:02:37 +0000 (11:02 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 6 Jul 2006 11:02:37 +0000 (11:02 +0000)
git-svn-id: file:///home/dpavlin/svn/Biblio-Isis/trunk@44 4670fa4d-42ec-0310-ab5b-a66af6943492

lib/Biblio/Isis.pm

index ba32c69..5461657 100644 (file)
@@ -475,7 +475,10 @@ sub to_hash {
                foreach my $l (@{$row->{$k}}) {
 
                        # filter output
                foreach my $l (@{$row->{$k}}) {
 
                        # filter output
-                       $l = $self->{'hash_filter'}->($l) if ($self->{'hash_filter'});
+                       if ($self->{'hash_filter'}) {
+                               $l = $self->{'hash_filter'}->($l);
+                               next unless defined($l);
+                       }
 
                        my $val;
 
 
                        my $val;