From dc7de751a271671f442edbcff6da9545525bffbb Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Wed, 18 Dec 2013 11:20:05 +0100 Subject: [PATCH] BZ11412: Bulkmarcimport can crash when searching for duplicates bulkmarcimport.pl can crash when searching for duplicates if the 005 field from the incoming or local record is not defined. This patch fixes it. --- misc/migration_tools/bulkmarcimport.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index 9ca7b31..3b7befd 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -245,7 +245,8 @@ RECORD: while ( ) { $id = GetRecordId( $marcrecord, $tagid, $subfieldid ); if ( $authorities && $marcFlavour ) { #Skip if authority in database is the same as the on in database - if ( $marcrecord->field('005')->data >= $record->field('005')->data ) { + if ( $marcrecord->field('005') && $record->field('005')->data && + $marcrecord->field('005')->data >= $record->field('005')->data ) { if ($yamlfile) { $yamlhash->{$originalid}->{'authid'} = $id; -- 1.8.3.2