Skip to content

Commit

Permalink
Improved empty check (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcop1 authored Oct 31, 2024
1 parent ed89486 commit 9037901
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Mapping/Operator/Factory/Numeric.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 9037901

Please sign in to comment.