mirror of
https://github.com/minio/minio.git
synced 2025-01-26 22:23:15 -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)
|
return fmt.Errorf("Error parsing response body: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
indices := v["indices"].([]interface{})
|
indices, ok := v["indices"].([]interface{})
|
||||||
for _, index := range indices {
|
if ok {
|
||||||
name := index.(map[string]interface{})["name"]
|
for _, index := range indices {
|
||||||
if name == args.Index {
|
name := index.(map[string]interface{})["name"]
|
||||||
found = true
|
if name == args.Index {
|
||||||
break
|
found = true
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user