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(
sub make_closure_spanset {
my $closures = shift;
+ return undef unless $closures;
my $spanset = DateTime::SpanSet->empty_set;
for my $k ( keys %$closures ) {
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;