From 830dfd19bcef408a72b1964159049e5f09221e3f Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 27 Jul 2015 11:16:56 -0400 Subject: [PATCH] Bug 14598 [QA Followup] - Don't die on bad barcode --- C4/Circulation.pm | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index d7cda99..ce0f652 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1751,8 +1751,10 @@ sub AddReturn { my $stat_type = 'return'; # get information on item - my $item = GetItem( undef, $barcode ) - or die "GetItem( undef, $barcode ) failed"; + my $item = GetItem( undef, $barcode ); + unless ($item) { + return ( 0, { BadBarcode => $barcode } ); # no barcode means no item or borrower. bail out. + } my $itemnumber = $item->{ itemnumber }; my $itemtype = $item->{ itype }; -- 1.7.2.5