protect against broken cache
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 22 Jun 2006 19:00:25 +0000 (19:00 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 22 Jun 2006 19:00:25 +0000 (19:00 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4708 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm

index 058cdff..99a5ab9 100644 (file)
@@ -430,6 +430,7 @@ sub search_cache {
        my $start = $offset;
        my $end = $offset + $limit - 1;
 
+       return undef unless $cache;
        my $data = $cache->get_cache($key);
 
        return undef unless $data and ref $data eq 'ARRAY' and $$data[$start] and $$data[$end];
@@ -449,6 +450,7 @@ sub search_cache {
 
 sub put_cache {
        my( $key, $data ) = @_;
+       return undef unless $cache;
        $logger->debug("search_cache putting ".
                scalar(@$data)." items at key $key with timeout $cache_timeout");
        $cache->put_cache($key, $data, $cache_timeout);