diff --git a/dao/msg.go b/dao/msg.go index a0a7736..f87cca9 100644 --- a/dao/msg.go +++ b/dao/msg.go @@ -63,7 +63,12 @@ func GetAIStreamModelMsgCount() ([]AIStreamMsgModelIDCount, error) { //获取模型名称 for i, _ := range aiStreamMsgModelIDCounts { modelName := FindModelByIDV2(int(aiStreamMsgModelIDCounts[i].ModelID)) - aiStreamMsgModelIDCounts[i].ModelName = modelName[0].Description + if modelName == nil || len(modelName) == 0 { + aiStreamMsgModelIDCounts[i].ModelName = "未知模型" + } else { + aiStreamMsgModelIDCounts[i].ModelName = modelName[0].Description + } + } return aiStreamMsgModelIDCounts, nil }