Minor fix to stop warnings in HHVM

HHVM is a bit weird and will throw these warnings otherwise:

HipHop Warning: Cannot access property on non-object in /home/_____/public_html/wp-content/plugins/woocommerce/classes/class-wc-product-factory.php on line 36
HipHop Warning: Cannot access property on non-object in /home/_____/public_html/wp-content/plugins/woocommerce/classes/class-wc-product-factory.php on line 37