LP#1394989: Make users_of_interest test for defined actor.usr.card values
authorMichael Peters <mpeters@emeralddata.net>
Thu, 20 Nov 2014 22:41:44 +0000 (17:41 -0500)
committerBill Erickson <berickxx@gmail.com>
Mon, 10 Aug 2015 19:34:34 +0000 (15:34 -0400)
commit13da6b8cf47ec16284e3fe680a1fd0fbf8105b5c
treee7eebaa7dbc6cc5038f7bdf9bc39804e0ce00256
parent6177e5d12cd9833c6e51133f3a2bab80022b723a
LP#1394989: Make users_of_interest test for defined actor.usr.card values

If the open-ils.collections.users_of_interest API encounters a patron that
has a null "card" value in actor.usr the API will crash with an error like:

Received Exception:
Name: osrfMethodException
Status:  *** Call to [open-ils.collections.users_of_interest.retrieve] failed for session [1416515351.333446.1416515351406], thread trace [1]:
Can't call method "barcode" on an undefined value at /usr/local/share/perl/5.14.2/OpenILS/Application/Collections.pm line 299.

This patches users_of_interest to provide "undef" in the event that there is
not a proper barcode associated with the user when retrieving results for the
API call.

Signed-off-by: Michael Peters <mpeters@emeralddata.net>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm