diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index 0a1bc7ccc9..be31f50712 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -492,6 +492,7 @@ sub _convert_facets { $limit = @{ $data->{buckets} } if ( $limit > @{ $data->{buckets} } ); foreach my $term ( @{ $data->{buckets} }[ 0 .. $limit - 1 ] ) { my $t = $term->{key}; + next unless $t; # FIXME Currently we cannot search for an empty faceted field i.e. ln:"" to find records missing languages, though ES does count them correctly my $c = $term->{doc_count}; my $label; if ( exists( $special{$type} ) ) {