Don't try add/remove download permissions if order does not exist
This commit is contained in:
parent
d7c7527529
commit
bbe11fdd6b
|
@ -2203,7 +2203,7 @@ class WC_Admin_Post_Types {
|
||||||
foreach ( $existing_permissions as $existing_permission ) {
|
foreach ( $existing_permissions as $existing_permission ) {
|
||||||
$order = wc_get_order( $existing_permission->order_id );
|
$order = wc_get_order( $existing_permission->order_id );
|
||||||
|
|
||||||
if ( $order->id ) {
|
if ( ! empty( $order->id ) ) {
|
||||||
// Remove permissions
|
// Remove permissions
|
||||||
if ( ! empty( $removed_download_ids ) ) {
|
if ( ! empty( $removed_download_ids ) ) {
|
||||||
foreach ( $removed_download_ids as $download_id ) {
|
foreach ( $removed_download_ids as $download_id ) {
|
||||||
|
|
Loading…
Reference in New Issue