Fixed method returning in write context

This commit is contained in:
Claudio Sanches 2016-11-11 14:19:12 -02:00
parent 4daca5e110
commit 5a2947d059
1 changed files with 1 additions and 1 deletions

View File

@ -331,7 +331,7 @@ class WC_Product_Variation extends WC_Product_Simple {
$this->set_parent_id( $post_object->post_parent );
// The post doesn't have a parent id, therefore its invalid and we should prevent this being created.
if ( empty( $this->get_parent_id() ) ) {
if ( ! $this->get_parent_id() ) {
throw new Exception( sprintf( 'No parent product set for variation #%d', $this->get_id() ), 422 );
}