Преглед изворни кода

fix: check if token is nil before using it

JustSong пре 2 година
родитељ
комит
6b1a24d650
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      controller/billing.go

+ 1 - 1
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{