File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,15 @@ public function handlePurchaseRequest(array $data)
24
24
return $ this ->createCheckoutSession ($ data ['plan ' ], $ user );
25
25
}
26
26
27
- public function createCheckoutSession (string $ plan , ?User $ user = null )
27
+ public function createCheckoutSession (? string $ plan , ?User $ user = null )
28
28
{
29
+ // This method is somehow getting called without a plan being passed in.
30
+ // Not sure how (probably folks hacking or a bot thing),
31
+ // but we will just return early when this happens.
32
+ if (! $ plan ) {
33
+ return ;
34
+ }
35
+
29
36
// If a user isn't passed into this method, Livewire will instantiate
30
37
// a new User. So we need to check that the user exists before using it,
31
38
// and then use the authenticated user as a fallback.
You can’t perform that action at this time.
0 commit comments