From 4bdfc88d2241f6992f1601e280b51fa39d64f4f5 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 Signed-off-by: Lucas Gass --- 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