Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditional check for split #55

Merged
merged 9 commits into from
Nov 22, 2022
Merged
3 changes: 3 additions & 0 deletions sonic_data_client/db_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,9 @@ func tableData2Msi(tblPath *tablePath, useKey bool, op *string, msi *map[string]
var key string
// Split dbkey string into two parts and second part is key in table
keys := strings.SplitN(dbkey, tblPath.delimitor, 2)
if len(keys) < 2 {
return fmt.Errorf("dbkey: %s, failed split from delimitor %v", dbkey, tblPath.delimitor)
}
key = keys[1]
err = makeJSON_redis(msi, &key, op, fv)
}
Expand Down