Explorar o código

fix: check if token is nil before using it

JustSong %!s(int64=2) %!d(string=hai) anos
pai
achega
6b1a24d650
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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{