Skip to content

Commit 31b9953

Browse files
authored
Merge pull request #141 from mehrancodes/fix/handle-null-aliases-in-forge-service
Fix explode() null argument error in getFormattedAliases
2 parents b5a0ece + 826865b commit 31b9953

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/Services/Forge/ForgeService.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,13 @@ public function getFormattedDomainName(): string
8383

8484
public function getFormattedAliases(): array
8585
{
86-
$subdomain = $this->setting->subdomainName ?? $this->getFormattedBranchName();
86+
if ($this->setting->aliases === null) {
87+
return [];
88+
}
8789

88-
return collect(explode(',', $this->setting->aliases) ?? [])
90+
$subdomain = $this->setting->subdomainName ?? $this->getFormattedBranchName();
91+
92+
return collect(explode(',', $this->setting->aliases))
8993
->map(fn($alias) => GenerateDomainName::run(trim($alias), $subdomain))
9094
->toArray();
9195
}

0 commit comments

Comments
 (0)