Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: if public repository does not have a main branch

Andras Bacsaic618d912dbb1
diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php
index 371a14f0ba..4aee4c3bfb 100644
--- a/app/Http/Livewire/Project/New/PublicGitRepository.php
+++ b/app/Http/Livewire/Project/New/PublicGitRepository.php
@@ -76,13 +76,14 @@ class PublicGitRepository extends Component
$this->get_branch();
$this->selected_branch = $this->git_branch;
} catch (\Throwable $e) {
- return handleError($e, $this);
- }
- if (!$this->branch_found && $this->git_branch == 'main') {
- try {
- $this->git_branch = 'master';
- $this->get_branch();
- } catch (\Throwable $e) {
+ if (!$this->branch_found && $this->git_branch == 'main') {
+ try {
+ $this->git_branch = 'master';
+ $this->get_branch();
+ } catch (\Throwable $e) {
+ return handleError($e, $this);
+ }
+ } else {
return handleError($e, $this);
}
}