Przeglądaj źródła

fix: check if token is nil before using it

JustSong 2 lat temu
rodzic
commit
6b1a24d650
1 zmienionych plików z 1 dodań i 1 usunięć
  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{