-
-
Save luk1337/e54796b2b930a3a2b2023d570be01b6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From c2c107bf655b1e720edfdc9e133db76b08938934 Mon Sep 17 00:00:00 2001 | |
From: LuK1337 <priv.luk@gmail.com> | |
Date: Sat, 20 Aug 2016 15:55:47 +0200 | |
Subject: [PATCH] Handle null userMail | |
--- | |
app/Update/SubscriptionCheck.php | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) | |
diff --git a/app/Update/SubscriptionCheck.php b/app/Update/SubscriptionCheck.php | |
index c804941..c3d4b7a 100644 | |
--- a/app/Update/SubscriptionCheck.php | |
+++ b/app/Update/SubscriptionCheck.php | |
@@ -38,7 +38,7 @@ class SubscriptionCheck | |
->first(); | |
} | |
- $userLists = Subscription::where('subscription.user_id', $userMail->user_id) | |
+ $userLists = Subscription::where('subscription.user_id', $userMail ? $userMail->user_id : -1) | |
->whereNull('user_list.deleted_at') | |
->whereNull('subscription.deleted_at') | |
->leftJoin('user_list', 'subscription.user_list_id', '=', 'user_list.id') | |
@@ -83,7 +83,7 @@ class SubscriptionCheck | |
public function setSubscription() | |
{ | |
- return $this->userMail->id; | |
+ return $this->userMail ? $this->userMail->id : -1; | |
} | |
protected function error($reason) | |
-- | |
2.7.4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment