[open-ils-commits] r8108 -
branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Nov 21 11:25:10 EST 2007
Author: erickson
Date: 2007-11-21 11:07:29 -0500 (Wed, 21 Nov 2007)
New Revision: 8108
Modified:
branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
backporting some defensive method param checks
Modified: branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2007-11-21 16:06:37 UTC (rev 8107)
+++ branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2007-11-21 16:07:29 UTC (rev 8108)
@@ -1,4 +1,5 @@
package OpenILS::Application::AppUtils;
+# vim:noet:ts=4
use strict; use warnings;
use OpenILS::Application;
use base qw/OpenILS::Application/;
@@ -754,6 +755,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