foreach my $a (@$alerts) {
# filter on event type
if (defined $a->alert_type) {
- next if ($a->alert_type->event eq 'CHECKIN' && !$self->is_checkin && !$self->is_renewal);
- next if ($a->alert_type->event eq 'CHECKOUT' && !$self->is_checkout && !$self->is_renewal);
+ next if (defined $a->alert_type->event && $a->alert_type->event eq 'CHECKIN' && !$self->is_checkin && !$self->is_renewal);
+ next if (defined $a->alert_type->event && $a->alert_type->event eq 'CHECKOUT' && !$self->is_checkout && !$self->is_renewal);
next if (defined $a->alert_type->in_renew && $U->is_true($a->alert_type->in_renew) && !$self->is_renewal);
next if (defined $a->alert_type->in_renew && !$U->is_true($a->alert_type->in_renew) && $self->is_renewal);
}