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: isMember

Andras Bacsaidb8ffe50acfe
diff --git a/app/Livewire/Subscription/Index.php b/app/Livewire/Subscription/Index.php
index 6c1d8e66cb..b367e6dcca 100644
--- a/app/Livewire/Subscription/Index.php
+++ b/app/Livewire/Subscription/Index.php
@@ -15,7 +15,7 @@ class Index extends Component
if (!isCloud()) {
return redirect(RouteServiceProvider::HOME);
}
- if (auth()->user()->isMember()) {
+ if (auth()->user()?->isMember()) {
return redirect()->route('dashboard');
}
if (data_get(currentTeam(), 'subscription') && isSubscriptionActive()) {
diff --git a/app/Livewire/Subscription/Show.php b/app/Livewire/Subscription/Show.php
index 413997464d..2ae89806d6 100644
--- a/app/Livewire/Subscription/Show.php
+++ b/app/Livewire/Subscription/Show.php
@@ -11,7 +11,7 @@ class Show extends Component
if (!isCloud()) {
return redirect()->route('dashboard');
}
- if (auth()->user()->isMember()) {
+ if (auth()->user()?->isMember()) {
return redirect()->route('dashboard');
}
if (!data_get(currentTeam(), 'subscription')) {
diff --git a/app/Models/Team.php b/app/Models/Team.php
index e08ba7f5b1..29e434a5d2 100644
--- a/app/Models/Team.php
+++ b/app/Models/Team.php
@@ -22,7 +22,7 @@ class Team extends Model implements SendsDiscord, SendsEmail
protected static function booted()
{
static::saving(function ($team) {
- if (auth()->user()->isMember()) {
+ if (auth()->user()?->isMember()) {
throw new \Exception('You are not allowed to update this team.');
}
});