fix: runtime error: index out of range [1] with length 1
This commit is contained in:
parent
427b655b60
commit
46ac4cf28f
@ -13,8 +13,8 @@ import (
|
||||
|
||||
func parseOpenaiConfig(config string) (apiKey string, organization string) {
|
||||
parts := strings.Split(config, "|")
|
||||
if len(parts) != 2 {
|
||||
parts[1] = ""
|
||||
if len(parts) < 2 {
|
||||
parts = append(parts, "")
|
||||
}
|
||||
apiKey = parts[0]
|
||||
organization = parts[1]
|
||||
|
Loading…
Reference in New Issue
Block a user