From 6b1a24d650586bd500b06a2a7964b1572d5361b0 Mon Sep 17 00:00:00 2001 From: JustSong Date: Sun, 25 Jun 2023 10:40:54 +0800 Subject: [PATCH] fix: check if token is nil before using it --- controller/billing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/billing.go b/controller/billing.go index 559d5e67..da1ef13d 100644 --- a/controller/billing.go +++ b/controller/billing.go @@ -32,7 +32,7 @@ func GetSubscription(c *gin.Context) { if common.DisplayInCurrencyEnabled { amount /= common.QuotaPerUnit } - if token.UnlimitedQuota { + if token != nil && token.UnlimitedQuota { amount = 99999999.9999 } subscription := OpenAISubscriptionResponse{