mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
In case of SliceDP when index is higheter than number of colums return Not Found
This commit is contained in:
committed by
Dan Christian Bogos
parent
bd76b55ac5
commit
6994300b0b
@@ -54,8 +54,10 @@ func (cP *SliceDP) FieldAsInterface(fldPath []string) (data interface{}, err err
|
||||
return
|
||||
}
|
||||
err = nil // cancel previous err
|
||||
if cfgFieldIdx, err := strconv.Atoi(fldPath[0]); err != nil || len(cP.req) <= cfgFieldIdx {
|
||||
if cfgFieldIdx, err := strconv.Atoi(fldPath[0]); err != nil {
|
||||
return nil, fmt.Errorf("Ignoring record: %v with error : %+v", cP.req, err)
|
||||
} else if len(cP.req) <= cfgFieldIdx {
|
||||
return nil, utils.ErrNotFound
|
||||
} else {
|
||||
data = cP.req[cfgFieldIdx]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user