From: miker Date: Wed, 11 Nov 2009 20:19:31 +0000 (+0000) Subject: protect against missing (or no) HOO and closure rows X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=dc12aee6dd1a567473b24c726d952d9c6d4a5801;p=evergreen%2Fpines.git protect against missing (or no) HOO and closure rows git-svn-id: svn://svn.open-ils.org/ILS/trunk@14870 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm index 709fe23d91..0b8afca44a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm @@ -207,6 +207,8 @@ __PACKAGE__->register_method( sub make_hoo_spanset { my $hoo = shift; + return undef unless $hoo; + my $today = shift || DateTime->now; my $tz = OpenSRF::AppSession->create('open-ils.actor')->request( @@ -242,6 +244,7 @@ sub make_hoo_spanset { sub make_closure_spanset { my $closures = shift; + return undef unless $closures; my $spanset = DateTime::SpanSet->empty_set; for my $k ( keys %$closures ) { @@ -287,7 +290,7 @@ sub org_closed_overlap { actor::org_unit::closed_date->db_Main->selectall_hashref( $sql, 'id', {}, $date, $ou ) ); - if ($closure_spanset->intersects( $target_date )) { + if ($closure_spanset && $closure_spanset->intersects( $target_date )) { my $closure_intersection = $closure_spanset->intersection( $target_date ); $begin = $closure_intersection->min; $end = $closure_intersection->max;