fix: check if token is nil before using it

This commit is contained in:
JustSong
2023-06-25 10:40:54 +08:00
parent 6b2b656468
commit 27177ee1f4
+1 -1
View File
@@ -32,7 +32,7 @@ func GetSubscription(c *gin.Context) {
if common.DisplayInCurrencyEnabled { if common.DisplayInCurrencyEnabled {
amount /= common.QuotaPerUnit amount /= common.QuotaPerUnit
} }
if token.UnlimitedQuota { if token != nil && token.UnlimitedQuota {
amount = 99999999.9999 amount = 99999999.9999
} }
subscription := OpenAISubscriptionResponse{ subscription := OpenAISubscriptionResponse{