Bug 10500: (follow-up) add checks for empty isbn
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
c1b782b634
commit
8d5d319f62
1 changed files with 5 additions and 1 deletions
|
@ -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 }) );
|
||||
|
|
Loading…
Reference in a new issue