fix: guard against null billing plan cache entries

This commit is contained in:
Torsten Dittmann
2026-04-06 22:05:10 +04:00
parent eeea06df19
commit d1bda39a87
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -143,7 +143,7 @@ export function getBasePlanFromGroup(billingPlanGroup: BillingPlanGroup): Models
const plansInfoStore = getPlansInfoStore();
const proPlans = Array.from(plansInfoStore.values()).filter(
(plan) => plan.group === billingPlanGroup
(plan): plan is Models.BillingPlan => !!plan && plan.group === billingPlanGroup
);
return proPlans.sort((a, b) => a.order - b.order)[0];
@@ -99,7 +99,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
loadFailedInvoices(project.teamId);
}
if (!includedInBasePlans) {
if (!includedInBasePlans && organizationPlan) {
// save the custom plan to `plansInfo` cache.
plansInfo.set(organization.billingPlanId, organizationPlan);
}