From 46f5d0dc84d102f10e388fb22c9b63e905098b6a Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Mon, 26 Sep 2011 10:01:24 -0400 Subject: [PATCH] Fix AppUtils.pm ou_ancestor_setting. Make sure it also returns undef when the setting is empty. Signed-off-by: Jason Stephenson --- Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm index 98e6805bc7..ce50017fe4 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm @@ -1347,7 +1347,8 @@ sub ou_ancestor_setting { my $query = {from => ['actor.org_unit_ancestor_setting', $name, $orgid]}; my $setting = $e->json_query($query); return undef unless (ref($setting) eq 'ARRAY'); - $setting = $setting->[0] if (ref($setting) eq 'ARRAY'); + $setting = $setting->[0]; + return undef unless($setting); return {org => $setting->{org_unit}, value => OpenSRF::Utils::JSON->JSON2perl($setting->{value})}; } -- 2.11.0