Bug 5430: Follow-up, fixes error message when no 001 exists
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Sun, 28 Nov 2010 12:40:36 +0000 (13:40 +0100)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 29 Nov 2010 18:01:17 +0000 (07:01 +1300)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Biblio.pm

index 4102e23..c3a3094 100644 (file)
@@ -1269,8 +1269,12 @@ sub GetMarcControlnumber {
     # Control number or Record identifier are the same field in MARC21 and UNIMARC
     # Keep $marcflavour for possible later use
     if ($marcflavour eq "MARC21" || $marcflavour eq "UNIMARC") {
-        $controlnumber = $record->field('001')->data();
+        my $controlnumberField = $record->field('001');
+        if ($controlnumberField) {
+            $controlnumber = $controlnumberField->data();
+        }
     }
+    return $controlnumber;
 }
 
 =head2 GetMarcNotes