Bug 31192: Check for item before calling is_bundle

The code in here is weird.. we really aught to check for the item before
anything else and throw an error to screen if we don't find one... but
my patch takes the simple option, and the one taken elsewhere in the
script.. to just check for item being defined before calling a method
upon it.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2022-07-20 09:29:39 +01:00 committed by Tomas Cohen Arazi
parent e37359cae9
commit de6ca8aa3d
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 1 deletions

View File

@ -410,7 +410,7 @@ if ($barcode) {
}
# Mark missing bundle items as lost and report unexpected items
if ( $item->is_bundle && $query->param('confirm_items_bundle_return') ) {
if ( $item && $item->is_bundle && $query->param('confirm_items_bundle_return') ) {
my $BundleLostValue = C4::Context->preference('BundleLostValue');
my $barcodes = $query->param('verify-items-bundle-contents-barcodes');
my @barcodes = map { s/^\s+|\s+$//gr } ( split /\n/, $barcodes );