mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 08:08:45 +05:00
Update *empty filter
This commit is contained in:
committed by
Dan Christian Bogos
parent
6186a38a66
commit
83a5041286
@@ -288,6 +288,9 @@ func (fltr *FilterRule) passEmpty(dP config.DataProvider) (bool, error) {
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
if val == nil {
|
||||
return true, nil
|
||||
}
|
||||
rval := reflect.ValueOf(val)
|
||||
if rval.Type().Kind() == reflect.Ptr {
|
||||
if rval.IsNil() {
|
||||
|
||||
@@ -627,6 +627,7 @@ func TestInlineFilterPassFiltersForEvent(t *testing.T) {
|
||||
"EmptySlice": []string{""},
|
||||
"EmptyMap": map[string]string{"": ""},
|
||||
"EmptyPtr": &struct{}{},
|
||||
"EmptyPtr2": &struct{}{},
|
||||
"EmptyPtrSlice": &[]string{""},
|
||||
"EmptyPtrMap": &map[string]string{"": ""},
|
||||
}
|
||||
@@ -637,6 +638,7 @@ func TestInlineFilterPassFiltersForEvent(t *testing.T) {
|
||||
"EmptySlice": []string{},
|
||||
"EmptyMap": map[string]string{},
|
||||
"EmptyPtr": testnil,
|
||||
"EmptyPtr2": nil,
|
||||
"EmptyPtrSlice": &[]string{},
|
||||
"EmptyPtrMap": &map[string]string{},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user