From: berick Date: Thu, 26 May 2011 18:44:48 +0000 (-0400) Subject: Protect against empty lists of linked bib searches X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4e1432dc5f5c1f0353b7a02564b555367366e3e7;p=evergreen%2Fjoelewis.git Protect against empty lists of linked bib searches Instead of returning undef when passed an empty list of bibs, always return an array from open-ils.cat.authority.records.count_linked_bibs Apart from consistency, this prevents JS errors in the Manage Authorities UI. Signed-off-by: berick --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/Authority.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/Authority.pm index 1995edf887..9e6055739c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/Authority.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/Authority.pm @@ -194,7 +194,7 @@ sub count_linked_bibs { my $editor = new_editor(); - my $link_count; + my $link_count = []; my @clean_records; for my $auth ( @$records ) { # Protection against SQL injection? Might be overkill.