From dfbb40ed69a28b512a617b88933a150ccfd77264 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Wed, 10 Oct 2018 11:44:05 +0100 Subject: [PATCH] Bug 21530 Test return from Libraries lookup If library lookup failed process aborts when methods called on null return. Test return - if null continue processing remaining libraries output error indicating branchcode that triggered error --- misc/cronjobs/overdue_notices.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 8c42335c2c..8dc6f67228 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -453,6 +453,10 @@ foreach my $branchcode (@branches) { } my $library = Koha::Libraries->find($branchcode); + if (!$library) { + warn "Unable to locate library for $branchcode skipping"; + next; + } my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress'); my @output_chunks; # may be sent to mail or stdout or csv file. -- 2.17.1