Skip to content

Commit 63e9368

Browse files
committed
fix: undefined (reading 'billingNextInvoiceDate')
When moving to a page without $organization, org is undefined and results in this "undefined (reading 'billingNextInvoiceDate')" error.
1 parent 02a6ba9 commit 63e9368

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib/stores/billing.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ export function checkForEnterpriseTrial(org: Organization) {
287287
}
288288

289289
export function calculateEnterpriseTrial(org: Organization) {
290+
if (!org || !org.billingNextInvoiceDate) return 0;
290291
const endDate = new Date(org.billingNextInvoiceDate);
291292
const startDate = new Date(org.billingCurrentInvoiceDate);
292293
const today = new Date();

0 commit comments

Comments
 (0)