Fix for #8691: Variation without parent will not cause 500.

This commit is contained in:
nils-fredrik@maksimer.no 2015-07-30 23:32:24 +02:00
parent 09145181e5
commit f4db67bcbc
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ class WC_API_Products extends WC_API_Resource {
}
// add the parent product data to an individual variation
if ( $product->is_type( 'variation' ) ) {
if ( $product->is_type( 'variation' ) && $product->parent ) {
$product_data['parent'] = $this->get_product_data( $product->parent );
}