Trapping fatal error that occurs if you call GetCOinsBiblio with a biblionumber that...
authorChris Cormack <chrisc@catalyst.net.nz>
Mon, 22 Mar 2010 22:21:21 +0000 (11:21 +1300)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 7 Apr 2010 12:43:29 +0000 (08:43 -0400)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
C4/Biblio.pm

index 17796f3..9669752 100755 (executable)
@@ -1146,6 +1146,11 @@ sub GetCOinSBiblio {
     my $record = GetMarcBiblio($biblionumber);
 
     # get the coin format
+    if ( ! $record ) {
+       # can't get a valid MARC::Record object, bail out at this point
+       warn "We called GetMarcBiblio with a biblionumber that doesn't exist biblionumber=$biblionumber";
+       return;
+    }
     my $pos7 = substr $record->leader(), 7, 1;
     my $pos6 = substr $record->leader(), 6, 1;
     my $mtx;