woothemes/woocommerce — pull request #1854 by Geczy (2012-11-27 16:18:44+00:00)
Title: Fix when instantiating WC_Product_Variation when it isn't a variation

( ! ) Notice: Trying to get property of non-object in C:\wamp\www\woocommerce\wp-includes\post-template.php on line 30

```php
$this->id = ! empty( $args['parent_id'] ) ? intval( $args['parent_id'] ) : wp_get_post_parent_id( $this->variation_id );
```

In the event a new WC_Product_Variation is instantiated on a non-variation ID

There might be a better way to handle the issue, though, than to just return false and null out all the fields? Maybe return get_product ( $this->variation_id ) somehow.