mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-20 02:34:02 +00:00
fix: check if token is nil before using it
This commit is contained in:
@@ -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{
|
||||||
|
Reference in New Issue
Block a user