[open-ils-commits] r7983 -
trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Nov 4 07:00:30 EST 2007
Author: dbs
Date: 2007-11-04 06:45:14 -0500 (Sun, 04 Nov 2007)
New Revision: 7983
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
Warn and return undef if find_org() does not receive expected arguments.
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2007-11-04 11:24:46 UTC (rev 7982)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2007-11-04 11:45:14 UTC (rev 7983)
@@ -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 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}) {
More information about the open-ils-commits
mailing list