From c4ab843429ae56df34c69b3ed76a77fe9b7d3fb2 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 18 Aug 2016 16:33:00 +0000 Subject: [PATCH] Bug 16272 [QA Followup] - Indexer fails on indexing temparary testing records Signed-off-by: Kyle M Hall --- Koha/ElasticSearch/Indexer.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Koha/ElasticSearch/Indexer.pm b/Koha/ElasticSearch/Indexer.pm index 258c6c50f4..3c6d144019 100644 --- a/Koha/ElasticSearch/Indexer.pm +++ b/Koha/ElasticSearch/Indexer.pm @@ -177,8 +177,10 @@ sub _sanitise_records { # the Tannhauser gate. MARC records where 999$c doesn't match the # biblionumber column. All those moments will be lost in time... like # tears in rain... - $rec->delete_fields($rec->field('999')); - $rec->append_fields(MARC::Field->new('999','','','c' => $bibnum, 'd' => $bibnum)); + if ( $rec ) { + $rec->delete_fields($rec->field('999')); + $rec->append_fields(MARC::Field->new('999','','','c' => $bibnum, 'd' => $bibnum)); + } } } -- 2.39.5