Check product exists.

@coe
This commit is contained in:
Mike Jolley 2013-05-23 13:27:12 +01:00
parent c3602cf17a
commit 28933f1fec
1 changed files with 2 additions and 1 deletions

View File

@ -545,7 +545,8 @@ function woocommerce_product_data_box() {
$product = get_product( $product_id );
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product->get_formatted_name() ) . '</option>';
if ( $product )
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product->get_formatted_name() ) . '</option>';
}
}
?>