[open-ils-commits] r14870 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Nov 11 15:19:36 EST 2009


Author: miker
Date: 2009-11-11 15:19:31 -0500 (Wed, 11 Nov 2009)
New Revision: 14870

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
Log:
protect against missing (or no) HOO and closure rows

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm	2009-11-11 18:52:01 UTC (rev 14869)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm	2009-11-11 20:19:31 UTC (rev 14870)
@@ -207,6 +207,8 @@
 
 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_closure_spanset {
     my $closures = shift;
+    return undef unless $closures;
 
     my $spanset = DateTime::SpanSet->empty_set;
     for my $k ( keys %$closures ) {
@@ -287,7 +290,7 @@
         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;



More information about the open-ils-commits mailing list