Преглед на файлове

fix: check if token is nil before using it

JustSong преди 3 години
родител
ревизия
27177ee1f4
променени са 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{