Просмотр исходного кода

fix: check if token is nil before using it

JustSong 2 лет назад
Родитель
Сommit
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 {
 	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{