Skip to content

Commit

Permalink
Added null check to Billpayer::getName()
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Sep 21, 2023
1 parent f7a3ed0 commit 83c79ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/Order/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Order/Models/Billpayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getPhone(): ?string

public function getName(): string
{
if ($this->isOrganization()) {
if ($this->isOrganization() && $this->getCompanyName()) {
return $this->getCompanyName();
}

Expand Down

0 comments on commit 83c79ce

Please sign in to comment.