You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add null-guard for $this->membership in downgrade cart type paths (#898)
When custom/out-of-tree code sets cart_type to 'downgrade' without
calling build_from_membership(), $this->membership can be null,
causing a fatal NPE in get_billing_start_date() and
get_billing_next_charge_date().
Add a Yoda-style null check before dereferencing $membership in both
downgrade blocks:
- get_billing_start_date(): return null on null membership
- get_billing_next_charge_date(): return $smallest_next_charge on null membership
Add two tests using an anonymous subclass that overrides build_cart()
to simulate the out-of-tree NPE scenario.
Resolves#897
0 commit comments