From a2cb829d27d56d3d5ac1ab2dece3ae9ddd38a32a Mon Sep 17 00:00:00 2001 From: Frank Fenor Date: Sat, 24 Feb 2024 17:59:48 +0100 Subject: [PATCH] Skip empty values --- src/Services/InfoProviderSystem/Providers/LCSCProvider.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Services/InfoProviderSystem/Providers/LCSCProvider.php b/src/Services/InfoProviderSystem/Providers/LCSCProvider.php index 563f5da8..eea43f61 100755 --- a/src/Services/InfoProviderSystem/Providers/LCSCProvider.php +++ b/src/Services/InfoProviderSystem/Providers/LCSCProvider.php @@ -270,8 +270,11 @@ class LCSCProvider implements InfoProviderInterface foreach ($attributes as $attribute) { + //Skip this attribute if it's empty + if (in_array(trim($attribute['paramValueEn']), array('', '-'))) { + continue; //If the attribute contains a tilde we assume it is a range - if (str_contains($attribute['paramValueEn'], '~')) { + } elseif (str_contains($attribute['paramValueEn'], '~')) { $parts = explode('~', $attribute['paramValueEn']); if (count($parts) === 2) { //Try to extract number and unit from value (allow leading +)