Error: PHP Notice: Trying to get property 'id' of non-object in wp-content/plugins/give-recurring/src/Webhooks/Stripe/Listeners/CustomerSubscriptionCreated.php on line 33 #7688
Labels
type: bug
Existing functionality is broken
User Story
I found this error in my site log.
Details
PHP Notice: Trying to get property 'id' of non-object in wp-content/plugins/give-recurring/src/Webhooks/Stripe/Listeners/CustomerSubscriptionCreated.php on line 33
According to my analysis, the problem comes from the expected return type of the
CustomerSubscriptionCreated@getSubscription
method.CustomerSubscriptionCreated@processEvent
seems to assume that it will necessarily be aGive_Subscription
.While parsing the function, it sometimes returns the result of a call to
give_recurring_get_subscription_by
.And this last function specifies a return
@return bool|Give_Subscription
.The type
@var bool $subscription
is not expected by the functionCustomerSubscriptionCreated@processEvent
hence our error...The text was updated successfully, but these errors were encountered: