From bbe11fdd6bcc2f6fb1361ddcf9302b234a73368b Mon Sep 17 00:00:00 2001 From: matttallan Date: Tue, 8 Sep 2015 15:28:38 +1000 Subject: [PATCH] Don't try add/remove download permissions if order does not exist --- includes/admin/class-wc-admin-post-types.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/class-wc-admin-post-types.php b/includes/admin/class-wc-admin-post-types.php index cdee3e37cdc..9cb4c9ddbc3 100644 --- a/includes/admin/class-wc-admin-post-types.php +++ b/includes/admin/class-wc-admin-post-types.php @@ -2203,7 +2203,7 @@ class WC_Admin_Post_Types { foreach ( $existing_permissions as $existing_permission ) { $order = wc_get_order( $existing_permission->order_id ); - if ( $order->id ) { + if ( ! empty( $order->id ) ) { // Remove permissions if ( ! empty( $removed_download_ids ) ) { foreach ( $removed_download_ids as $download_id ) {