From 1a1d50fb44a7b3b4583c2a05fe8c05f9da7baaac Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 23 Mar 2010 11:21:21 +1300 Subject: [PATCH] Trapping fatal error that occurs if you call GetCOinsBiblio with a biblionumber that doesn't exist in the Koha database Signed-off-by: Galen Charlton --- C4/Biblio.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 17796f316c..9669752423 100755 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -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; -- 2.39.5