From 529b0a47ae46c73603905a400e742477a5859bd5 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 16 Apr 2014 11:03:54 -0400 Subject: [PATCH] Bug 10500 [QA Followup] - Add checks for empty isbn --- C4/Koha.pm | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 3d4672d..2479b9d 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -1484,7 +1484,7 @@ sub _isbn_cleanup { format => 'ISBN-10', strip_hyphens => 1, } - ); + ) if $isbn; } =head2 NormalizedISBN @@ -1511,6 +1511,8 @@ sub NormalizeISBN { my $strip_hyphens = $params->{strip_hyphens}; my $format = $params->{format}; + return unless $string; + my $isbn = Business::ISBN->new($string); if ( $isbn && $isbn->error != Business::ISBN::BAD_ISBN ) { @@ -1548,6 +1550,8 @@ sub NormalizeISBN { sub GetVariationsOfISBN { my ($isbn) = @_; + return unless $isbn; + my @isbns; push( @isbns, NormalizeISBN({ isbn => $isbn }) ); -- 1.7.2.5