Skip to content

Commit

Permalink
Issue #182 - Fix Envato Fatal Error
Browse files Browse the repository at this point in the history
  • Loading branch information
BjornKraft authored and bradyvercher committed Oct 9, 2024
1 parent f8795e4 commit ad97049
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Integration/EnvatoMarket.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ public function filter_package_download_url( string $download_url ): string {
$download_url = '';

if ( $vars['item_id'] ) {
$args = $this->get_bearer_args( $vars['item_id'] );
$download_url = envato_market()->api()->download( $vars['item_id'], $args );
$args = $this->get_bearer_args( $vars['item_id'] );
$envato_download_url = envato_market()->api()->download( $vars['item_id'], $args );
// Envato returns false, if the download fails. i.e id is missing, product does not exist anymore.
if ( $envato_download_url ) {
$download_url = $envato_download_url;
}
}
}

Expand Down

0 comments on commit ad97049

Please sign in to comment.