From: dbs Date: Sun, 4 Nov 2007 11:45:14 +0000 (+0000) Subject: Warn and return undef if find_org() does not receive expected arguments. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6126a23b819fc08e1188bc1a1c751b86a02a2a94;p=Evergreen.git Warn and return undef if find_org() does not receive expected arguments. git-svn-id: svn://svn.open-ils.org/ILS/trunk@7983 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index 65143aa659..04ac23dbed 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -1,4 +1,5 @@ package OpenILS::Application::AppUtils; +# vim:noet:ts=4 use strict; use warnings; use base qw/OpenSRF::Application/; use OpenSRF::Utils::Cache; @@ -753,6 +754,13 @@ sub fetch_stat_cat_entry { sub find_org { my( $self, $org_tree, $orgid ) = @_; + if (!$org_tree) { + $logger->warn("find_org() did not receive a value for \$org_tree"); + return undef; + } elsif (!$orgid) { + $logger->warn("find_org() did not receive a value for \$orgid"); + return undef; + } return $org_tree if ( $org_tree->id eq $orgid ); return undef unless ref($org_tree->children); for my $c (@{$org_tree->children}) {