From b3d25b6671b3a585960b6a7ce8330e0798633489 Mon Sep 17 00:00:00 2001 From: dbs Date: Tue, 26 Apr 2011 17:24:16 +0000 Subject: [PATCH] Protect against errors returned by open-ils.search If open-ils.search returns an error rather than a result, prevent authority_control_fields.pl from bombing out completely; instead, flag the problem in STDERR and move on to the next record. Signed-off-by: Dan Scott git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@20325 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/support-scripts/authority_control_fields.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Open-ILS/src/support-scripts/authority_control_fields.pl b/Open-ILS/src/support-scripts/authority_control_fields.pl index a7b6b752dc..290d0369b8 100755 --- a/Open-ILS/src/support-scripts/authority_control_fields.pl +++ b/Open-ILS/src/support-scripts/authority_control_fields.pl @@ -395,6 +395,12 @@ foreach my $rec_id (@records) { # print Dumper($validates); + # Protect against failed (error condition) search request + if (!$validates) { + print STDERR "Search for matching authority failed; record # $rec_id\n"; + next; + } + if (scalar(@$validates) == 0) { next; } -- 2.11.0