Skip to content

Commit

Permalink
Prevent calling purchase functions without purchase
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig committed Dec 10, 2024
1 parent 2a9d764 commit b58596b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions client/me/purchases/manage-purchase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ class ManagePurchase extends Component<
const { purchase, siteSlug, redirectTo } = this.props;
const options = redirectTo ? { redirectTo } : undefined;
const isSitelessRenewal =
isAkismetTemporarySitePurchase( purchase ) || isMarketplaceTemporarySitePurchase( purchase );
purchase &&
( isAkismetTemporarySitePurchase( purchase ) ||
isMarketplaceTemporarySitePurchase( purchase ) );

if ( ! purchase ) {
return;
Expand Down Expand Up @@ -1692,10 +1694,9 @@ export default connect( ( state: IAppState, props: ManagePurchaseProps ) => {
hasSetupAds: Boolean(
site?.options?.wordads || isRequestingWordAdsApprovalForSite( state, site )
),
hasCompletedCancelPurchaseSurvey: getPreference(
state,
getCancelPurchaseSurveyCompletedPreferenceKey( purchase?.id )
),
hasCompletedCancelPurchaseSurvey: purchase
? getPreference( state, getCancelPurchaseSurveyCompletedPreferenceKey( purchase.id ) )
: false,
isAtomicSite: isSiteAtomic( state, siteId ),
isDomainOnlySite: purchase && isDomainOnly( state, purchase.siteId ),
isProductOwner,
Expand Down

0 comments on commit b58596b

Please sign in to comment.