Skip to content

Commit

Permalink
Fix issue booting model if country code is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Hall committed Feb 25, 2020
1 parent 67765c5 commit 78d527f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Models/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public function addressable(): MorphTo

public function getCountryAttribute(): ?Country
{
if (!$this->country_code) {
return null;
}

return (new Countries())->getByIsoCode($this->country_code);
}

Expand Down

0 comments on commit 78d527f

Please sign in to comment.