protect against receive nothing
authorGalen Charlton <gmc@esilibrary.com>
Wed, 3 Aug 2016 20:32:28 +0000 (16:32 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 3 Aug 2016 20:32:28 +0000 (16:32 -0400)
... as might be the case if the user hasn't opted in

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircNotify.pm

index 7265832..83de416 100644 (file)
@@ -62,6 +62,7 @@ sub circ_batch_notify {
             my $self = shift;
             my $req = shift;
 
+            return unless $req->{response}->[0];
             my $event = $req->{response}->[0]->content;
             return unless $event;
             $event = $e->retrieve_action_trigger_event($event);
@@ -92,6 +93,8 @@ sub circ_batch_notify {
         success_handler     => sub {
             my $self = shift;
             my $req = shift;
+
+            return unless $req->{response}->[0];
             $client->respond( $req->{response}->[0]->content );
         },
     );