Skip to content

Commit

Permalink
Merge pull request #3 from woocommerce/SiR-DanieL-patch-1
Browse files Browse the repository at this point in the history
Fix fatal error return value in write context
  • Loading branch information
roykho authored Feb 14, 2017
2 parents 01ac58e + 500f00a commit 576385e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bookings-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,10 @@ public function import_global_rules() {
*/
public function export_product() {
try {
$product_id = isset( $_POST['product_id'] ) ? absint( $_POST['product_id'] ) : '';

if ( empty( $product_id ) || empty( get_post_status( $product_id ) ) ) {
$product_id = isset( $_POST['product_id'] ) ? absint( $_POST['product_id'] ) : '';
$product_status = get_post_status( $product_id );

if ( empty( $product_id ) || empty( $product_status ) ) {
throw new Exception( 'This booking product does not exist!' );
}

Expand Down

0 comments on commit 576385e

Please sign in to comment.