diff --git a/Changelog.md b/Changelog.md index e61d86a6..9936d6bb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -21,6 +21,7 @@ - Added and extended Foundation Channel model that contains the known relationships to the "channelable" models - Added the `withinChannel[s]` methods to the ProductSearch class - Added the `Features` accessor class, which is a syntactic sugar for areas of the configuration +- Fixed possible null return type on Billpayer::getName() when is_organization is true but the company name is null ## 3.x Series diff --git a/src/Order/Changelog.md b/src/Order/Changelog.md index 030c5d2a..23df8df8 100644 --- a/src/Order/Changelog.md +++ b/src/Order/Changelog.md @@ -11,6 +11,7 @@ - Changed minimal Enum requirement to v4.1 - Upgraded to Konekt Address and User modules to v3 - Added the `currency` field to the orders table +- Fixed possible null return type on Billpayer::getName() when is_organization is true but the company name is null ## 3.x Series diff --git a/src/Order/Models/Billpayer.php b/src/Order/Models/Billpayer.php index ee3fb99f..7633cc88 100644 --- a/src/Order/Models/Billpayer.php +++ b/src/Order/Models/Billpayer.php @@ -56,7 +56,7 @@ public function getPhone(): ?string public function getName(): string { - if ($this->isOrganization()) { + if ($this->isOrganization() && $this->getCompanyName()) { return $this->getCompanyName(); }