diff --git a/includes/cart/functions.php b/includes/cart/functions.php index 7b0bd263e6..56bb5c8dc4 100644 --- a/includes/cart/functions.php +++ b/includes/cart/functions.php @@ -135,7 +135,7 @@ function edd_get_cart_quantity() { function edd_add_to_cart( $download_id, $options = array() ) { $download = get_post( $download_id ); - if( 'download' != $download->post_type ) + if( 'download' != ($download->post_type ?? null) ) return; // Not a download product if ( ! current_user_can( 'edit_post', $download->ID ) && $download->post_status != 'publish' ) {