From 4e9e2b97a6f99512dff0267b7da62c3561e70006 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 13 Jan 2026 16:30:10 +0000 Subject: [PATCH] Bug 38262: (follow-up) Check for extended attributes before iterating --- Koha/REST/V1/Acquisitions/Vendors.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/REST/V1/Acquisitions/Vendors.pm b/Koha/REST/V1/Acquisitions/Vendors.pm index 33037121abd..3e7a727c019 100644 --- a/Koha/REST/V1/Acquisitions/Vendors.pm +++ b/Koha/REST/V1/Acquisitions/Vendors.pm @@ -114,7 +114,7 @@ sub add { $vendor_to_store->aliases( $aliases || [] ); $vendor_to_store->interfaces( $interfaces || [] ); - if ( scalar(@$extended_attributes) > 0 ) { + if ( $extended_attributes && scalar(@$extended_attributes) > 0 ) { my @extended_attributes = map { { 'id' => $_->{field_id}, 'value' => $_->{value} } } @{$extended_attributes}; $vendor_to_store->extended_attributes( \@extended_attributes ); @@ -160,7 +160,7 @@ sub update { $vendor->aliases( $aliases || [] ) if defined $aliases; $vendor->interfaces( $interfaces || [] ) if defined $interfaces; - if ( scalar(@$extended_attributes) > 0 ) { + if ( $extended_attributes && scalar(@$extended_attributes) > 0 ) { my @extended_attributes = map { { 'id' => $_->{field_id}, 'value' => $_->{value} } } @{$extended_attributes}; $vendor->extended_attributes( \@extended_attributes ); -- 2.39.5