From: Galen Charlton Date: Fri, 19 May 2017 02:28:49 +0000 (-0400) Subject: LP1574141: minor code tweaks X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1c6b0d4895d817542e4d5193b1ca36372d8cd4f4;p=working%2FEvergreen.git LP1574141: minor code tweaks - return the BAD_PARAMS event if client provides neither patron ID nor contact value - more precisely identify missing parameters - standardize indentation Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index ba5868cca7..6cc2e8b558 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -4792,14 +4792,13 @@ sub mark_users_contact_invalid { return $e->die_event unless $e->checkauth; my $howfind = {}; - if ($patron_id){ + if (defined $patron_id && $patron_id ne "") { $howfind = {usr => $patron_id}; - } - elsif ($contact){ + } elsif (defined $contact && $contact ne "") { $howfind = {$contact_type => $contact}; - } - else{ #Error out if no patron id set or no contact is set. - return $e->die_event; + } else { + # Error out if no patron id set or no contact is set. + return OpenILS::Event->new('BAD_PARAMS'); } return OpenILS::Utils::BadContact->mark_users_contact_invalid(