diff --git a/classes/class-wc-cart.php b/classes/class-wc-cart.php index f663878b4c4..2a2bf50b3f8 100644 --- a/classes/class-wc-cart.php +++ b/classes/class-wc-cart.php @@ -135,7 +135,7 @@ class WC_Cart { $_product = get_product( $values['variation_id'] ? $values['variation_id'] : $values['product_id'] ); - if ( $_product->exists() && $values['quantity'] > 0 ) { + if ( !empty( $_product ) && $_product->exists() && $values['quantity'] > 0 ) { // Put session data into array. Run through filter so other plugins can load their own session data $this->cart_contents[ $key ] = apply_filters( 'woocommerce_get_cart_item_from_session', array(