Bug 16272 [QA Followup] - Indexer fails on indexing temparary testing records
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 18 Aug 2016 16:33:00 +0000 (16:33 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 9 Sep 2016 11:43:57 +0000 (11:43 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/ElasticSearch/Indexer.pm

index 258c6c5..3c6d144 100644 (file)
@@ -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));
+        }
     }
 }