From 90379012c03692455260ea9b364860c1afa4824f Mon Sep 17 00:00:00 2001 From: mcop1 <89011527+mcop1@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:23:23 +0100 Subject: [PATCH] Improved empty check (#432) --- src/Mapping/Operator/Factory/Numeric.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mapping/Operator/Factory/Numeric.php b/src/Mapping/Operator/Factory/Numeric.php index 13446b7..a0a7db7 100644 --- a/src/Mapping/Operator/Factory/Numeric.php +++ b/src/Mapping/Operator/Factory/Numeric.php @@ -35,11 +35,13 @@ public function process($inputData, bool $dryRun = false) $inputData = reset($inputData); } - if ($this->returnNullIfEmpty && empty($inputData)) { + $floatValue = floatval($inputData); + + if ($this->returnNullIfEmpty && empty($floatValue)) { return null; } - return floatval($inputData); + return $floatValue; } /**