From d2ff144c82e590ec7d0884d4cb5a9fa1766f5107 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Tue, 28 Feb 2017 17:28:31 -0800 Subject: [PATCH] LP#1668816: Prevent Internal Server Error in OPAC when logged-in user has no card Signed-off-by: Jeff Davis Signed-off-by: Kathy Lussier --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index f2f5d8f726..6aa1f5811d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -302,7 +302,8 @@ sub load_common { $ctx->{authtoken} = $e->authtoken; $ctx->{authtime} = $e->authtime; $ctx->{user} = $e->requestor; - $ctx->{active_card} = $self->editor->retrieve_actor_card($ctx->{user}->card)->barcode; + my $card = $self->editor->retrieve_actor_card($ctx->{user}->card); + $ctx->{active_card} = (ref $card) ? $card->barcode : undef; $ctx->{place_unfillable} = 1 if $e->requestor->wsid && $e->allowed('PLACE_UNFILLABLE_HOLD', $e->requestor->ws_ou); # The browser client does not set an OILS-Wrapper header (above). -- 2.43.2