From 8d5d319f6258e1356860663410329ada72daef60 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 16 Apr 2014 11:03:54 -0400 Subject: [PATCH] Bug 10500: (follow-up) add checks for empty isbn Signed-off-by: Martin Renvoize Signed-off-by: Galen Charlton --- C4/Koha.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 062a98f96a..5988249ae0 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -1564,7 +1564,7 @@ sub _isbn_cleanup { format => 'ISBN-10', strip_hyphens => 1, } - ); + ) if $isbn; } =head2 NormalizedISBN @@ -1591,6 +1591,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 ) { @@ -1628,6 +1630,8 @@ sub NormalizeISBN { sub GetVariationsOfISBN { my ($isbn) = @_; + return unless $isbn; + my @isbns; push( @isbns, NormalizeISBN({ isbn => $isbn }) ); -- 2.39.5