From 5904473479070652ce382821d21c0fbe2cf2cf5e Mon Sep 17 00:00:00 2001
From: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Date: Mon, 22 Jul 2024 13:29:06 +0100
Subject: [PATCH] Bug 28762: (follow-up) Remove warning in tests

Looks like a recent bug introduced a superflous warning, we just clean
that up here whilst we're in the code.
---
 Koha/Item.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Koha/Item.pm b/Koha/Item.pm
index 12283c1bc21..2c9318cc78e 100644
--- a/Koha/Item.pm
+++ b/Koha/Item.pm
@@ -99,7 +99,7 @@ sub store {
     }
 
     # Ensure barcode is either defined or undef
-    $self->barcode(undef) if $self->barcode eq '';
+    $self->barcode(undef) if ( defined($self->barcode) && $self->barcode eq '' );
 
     $self->barcode( C4::Circulation::barcodedecode( $self->barcode ) );
 
-- 
2.45.2