Only process downloads if valid order is found

Closes #8798
This commit is contained in:
Mike Jolley 2015-08-12 17:21:07 +01:00
parent c1c8a103af
commit 7a58c5417c
1 changed files with 1 additions and 1 deletions

View File

@ -308,7 +308,7 @@ function wc_downloadable_product_permissions( $order_id ) {
$order = wc_get_order( $order_id );
if ( $order->has_status( 'processing' ) && get_option( 'woocommerce_downloads_grant_access_after_payment' ) == 'no' ) {
if ( $order && $order->has_status( 'processing' ) && get_option( 'woocommerce_downloads_grant_access_after_payment' ) == 'no' ) {
return;
}