Skip to content

Commit

Permalink
Merge pull request #36 from pronamic/35-fatal-error-uncaught-error-ca…
Browse files Browse the repository at this point in the history
…ll-to-a-member-function-get_next_payment_date-on-null

Check if subscription is available, fixes #35
  • Loading branch information
rvdsteege authored Oct 25, 2023
2 parents 0be7f4a + 9682673 commit a5f301a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -1204,9 +1204,9 @@ public function replace_merge_tags( $text, $form, $entry, $url_encode, $esc_html

$subscription_id = gform_get_meta( rgar( $entry, 'id' ), 'pronamic_subscription_id' );

if ( ! empty( $subscription_id ) ) {
$subscription = get_pronamic_subscription( $subscription_id );
$subscription = empty( $subscription_id ) ? null : \get_pronamic_subscription( $subscription_id );

if ( null !== $subscription ) {
$next_payment_date = $subscription->get_next_payment_date();

if ( $next_payment_date ) {
Expand Down

0 comments on commit a5f301a

Please sign in to comment.