strangerstudios / pmpro-woocommerce

Connect Paid Memberships Pro with WooCommerce and WooCommerce Subscriptions to sell membership products and offer members-only product discounts.
https://www.paidmembershipspro.com/add-ons/pmpro-woocommerce/
46 stars 32 forks source link

Avoid fatal error: Uncaught Error: Call to a member function get_id() on bool #177

Closed mircobabini closed 1 year ago

mircobabini commented 1 year ago

$_product can be false. This is because the ->get_product() has these return types: \WC_Product|false. Then we should check if $_product instanceof \WC_Product or continue;

Cases: