From 1c6b0d4895d817542e4d5193b1ca36372d8cd4f4 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 18 May 2017 22:28:49 -0400 Subject: [PATCH] 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 --- .../src/perlmods/lib/OpenILS/Application/Actor.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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( -- 2.43.2