Protect against warnings when no isbn/upc provided
authorJeff Godin <jgodin@tadl.org>
Wed, 2 May 2012 14:25:15 +0000 (10:25 -0400)
committerJeff Godin <jgodin@tadl.org>
Wed, 2 May 2012 14:25:15 +0000 (10:25 -0400)
Protect against Perl giving us uninitialized value warnings when
isbn or upc has not been provided.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm

index 0f23634..1cf11c4 100644 (file)
@@ -258,6 +258,9 @@ sub fetch_response {
     my $isbn = $keys->{isbn}[0];
     my $upc = $keys->{upc}[0];
 
+    $isbn = '' if !defined($isbn);
+    $upc = '' if !defined($upc);
+
     my $url = $self->base_url . "?isbn=$isbn/$page&upc=$upc&client=$uname" . (($notype) ? '' : "&type=rw12");
     return $AC->get_url($url);
 }