Skip to content

Commit

Permalink
pb-1295
Browse files Browse the repository at this point in the history
  • Loading branch information
jostrowka committed Nov 21, 2024
1 parent b57223d commit 1fc2a7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes/cart/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ function edd_get_cart_quantity() {
function edd_add_to_cart( $download_id, $options = array() ) {
$download = get_post( $download_id );

if( 'download' != ($download->post_type ?? null) )
if (!$download) {
return;
}

if( 'download' != $download->post_type )
return; // Not a download product

if ( ! current_user_can( 'edit_post', $download->ID ) && $download->post_status != 'publish' ) {
Expand Down

0 comments on commit 1fc2a7a

Please sign in to comment.