From: erickson Date: Mon, 18 Feb 2008 21:55:14 +0000 (+0000) Subject: returning undef on not-found instead of 0 to prevent id=0 conflicts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=97dc744a65f627d1ad837aeb0407bcb9adeda1be;p=Evergreen.git returning undef on not-found instead of 0 to prevent id=0 conflicts git-svn-id: svn://svn.open-ils.org/ILS/trunk@8767 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 51a41e5e4c..915fade4ee 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -2615,15 +2615,13 @@ __PACKAGE__->register_method( / ); -# XXX Make me retun undef if no user has the ID - sub usrname_exists { my( $self, $conn, $auth, $usrname ) = @_; my $e = new_editor(authtoken=>$auth); return $e->event unless $e->checkauth; my $a = $e->search_actor_user({usrname => $usrname, deleted=>'f'}, {idlist=>1}); return $$a[0] if $a and @$a; - return 0; + return undef; } __PACKAGE__->register_method( @@ -2639,7 +2637,7 @@ sub barcode_exists { my $e = new_editor(authtoken=>$auth); return $e->event unless $e->checkauth; my $card = $e->search_actor_card({barcode => $barcode}); - return 0 unless @$card; + return undef unless @$card; return $card->[0]->usr; }