mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Fix Elastic crash with no index (#13406)
Removed naked assert. Fixes #13389
This commit is contained in:
parent
05fa790584
commit
9f652708ee
@ -419,12 +419,14 @@ func (c *esClientV7) createIndex(args ElasticsearchArgs) error {
|
||||
return fmt.Errorf("Error parsing response body: %v", err)
|
||||
}
|
||||
|
||||
indices := v["indices"].([]interface{})
|
||||
for _, index := range indices {
|
||||
name := index.(map[string]interface{})["name"]
|
||||
if name == args.Index {
|
||||
found = true
|
||||
break
|
||||
indices, ok := v["indices"].([]interface{})
|
||||
if ok {
|
||||
for _, index := range indices {
|
||||
name := index.(map[string]interface{})["name"]
|
||||
if name == args.Index {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user