From f5f61da4e9c58a33c668eb43c0afd3c3a03b0989 Mon Sep 17 00:00:00 2001 From: roykho Date: Wed, 16 Sep 2015 08:49:18 -0700 Subject: [PATCH] fixes a case were there are orphaned variations and trying to call the parent that doesn't exist --- includes/class-wc-product-variation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-product-variation.php b/includes/class-wc-product-variation.php index 93e3c26d3d5..1a03eb7797c 100644 --- a/includes/class-wc-product-variation.php +++ b/includes/class-wc-product-variation.php @@ -358,7 +358,7 @@ class WC_Product_Variation extends WC_Product { public function managing_stock() { if ( 'yes' === get_option( 'woocommerce_manage_stock', 'yes' ) ) { if ( 'no' === $this->manage_stock ) { - if ( $this->parent->managing_stock() ) { + if ( $this->parent && $this->parent->managing_stock() ) { return 'parent'; } } else {