Merge pull request #4601 from maxrice/master

Fix potential fatal error when fetching orders via API
This commit is contained in:
Mike Jolley 2014-01-31 04:46:36 -08:00
commit 0d0bdc340c
1 changed files with 1 additions and 1 deletions

View File

@ -185,7 +185,7 @@ class WC_API_Orders extends WC_API_Resource {
'tax_class' => ( ! empty( $item['tax_class'] ) ) ? $item['tax_class'] : null,
'name' => $item['name'],
'product_id' => ( isset( $product->variation_id ) ) ? $product->variation_id : $product->id,
'sku' => $product->get_sku(),
'sku' => is_object( $product ) ? $product->get_sku() : null,
);
}