Bug 4305 - prevent errors when handling invalid ISBN13 values
authorRobin Sheat <robin@catalyst.net.nz>
Wed, 20 Oct 2010 07:13:15 +0000 (20:13 +1300)
committerGalen Charlton <gmcharlt@gmail.com>
Thu, 21 Oct 2010 22:36:35 +0000 (18:36 -0400)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
C4/Koha.pm

index ab9131a..dc2bcfa 100644 (file)
@@ -1330,6 +1330,7 @@ sub _isbn_cleanup ($) {
     my $isbn = Business::ISBN->new( shift );
     return undef unless $isbn;
     $isbn = $isbn->as_isbn10 if $isbn->type eq 'ISBN13';
+    return undef unless $isbn;
     $isbn = $isbn->as_string;
     $isbn =~ s/-//g;
     return $isbn;