Skip to content

Commit

Permalink
Merge pull request #14 from techdivision/pac-239--invalid-gender
Browse files Browse the repository at this point in the history
PAC-239 - Allow null values for attribute 'gender' during custome…
  • Loading branch information
wagnert committed Sep 30, 2020
2 parents a018816 + 6eb1ed0 commit 4f0bb4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Observers/CustomerObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ protected function getGenderByValue($value)
return (integer) $this->availableGenders[$value];
}

// allow null values and empty strings
if ($value === null || $value === '') {
return null;
}

// throw an exception, if not
throw new \Exception(
$this->appendExceptionSuffix(
Expand Down

0 comments on commit 4f0bb4d

Please sign in to comment.