mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fixes panic for AttributeSv1.ProcessEvent with no attribute profile to match
This commit is contained in:
committed by
Dan Christian Bogos
parent
f899284ae1
commit
dcd645bbe5
@@ -238,7 +238,7 @@ func testAttributeSGetAttributeForEventNotFound(t *testing.T) {
|
||||
var reply *engine.AttributeProfile
|
||||
if err := attrSRPC.Call("ApierV1.GetAttributeProfile",
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "ATTR_3"}, &reply); err != nil {
|
||||
t.Error(err)
|
||||
t.Fatal(err)
|
||||
}
|
||||
reply.Compile()
|
||||
if !reflect.DeepEqual(eAttrPrf2, reply) {
|
||||
@@ -290,7 +290,7 @@ func testAttributeSGetAttributeForEventWithMetaAnyContext(t *testing.T) {
|
||||
var reply *engine.AttributeProfile
|
||||
if err := attrSRPC.Call("ApierV1.GetAttributeProfile",
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "ATTR_2"}, &reply); err != nil {
|
||||
t.Error(err)
|
||||
t.Fatal(err)
|
||||
}
|
||||
reply.Compile()
|
||||
if !reflect.DeepEqual(eAttrPrf2, reply) {
|
||||
@@ -299,7 +299,7 @@ func testAttributeSGetAttributeForEventWithMetaAnyContext(t *testing.T) {
|
||||
var attrReply *engine.AttributeProfile
|
||||
if err := attrSRPC.Call(utils.AttributeSv1GetAttributeForEvent,
|
||||
ev, &attrReply); err != nil {
|
||||
t.Error(err)
|
||||
t.Fatal(err)
|
||||
}
|
||||
attrReply.Compile()
|
||||
if !reflect.DeepEqual(eAttrPrf2, attrReply) {
|
||||
@@ -692,7 +692,7 @@ func testAttributeSSetAlsPrf(t *testing.T) {
|
||||
var reply *engine.AttributeProfile
|
||||
if err := attrSRPC.Call("ApierV1.GetAttributeProfile",
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "ApierTest"}, &reply); err != nil {
|
||||
t.Error(err)
|
||||
t.Fatal(err)
|
||||
}
|
||||
reply.Compile()
|
||||
if !reflect.DeepEqual(alsPrf, reply) {
|
||||
@@ -725,7 +725,7 @@ func testAttributeSUpdateAlsPrf(t *testing.T) {
|
||||
var reply *engine.AttributeProfile
|
||||
if err := attrSRPC.Call("ApierV1.GetAttributeProfile",
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "ApierTest"}, &reply); err != nil {
|
||||
t.Error(err)
|
||||
t.Fatal(err)
|
||||
}
|
||||
reply.Compile()
|
||||
if !reflect.DeepEqual(alsPrf, reply) {
|
||||
@@ -791,7 +791,7 @@ func testAttributeSSetAlsPrf2(t *testing.T) {
|
||||
var reply *engine.AttributeProfile
|
||||
if err := attrSRPC.Call("ApierV1.GetAttributeProfile",
|
||||
&utils.TenantID{Tenant: "golant", ID: "ATTR_972587832508_SESSIONAUTH"}, &reply); err != nil {
|
||||
t.Error(err)
|
||||
t.Fatal(err)
|
||||
}
|
||||
reply.Compile()
|
||||
if !reflect.DeepEqual(alsPrf, reply) {
|
||||
|
||||
@@ -215,7 +215,8 @@ func (alS *AttributeService) V1ProcessEvent(args *AttrArgsProcessEvent,
|
||||
}
|
||||
var apiRply *AttrSProcessEventReply // aggregate response here
|
||||
for i := 0; i < *args.ProcessRuns; i++ {
|
||||
evRply, err := alS.processEvent(args)
|
||||
var evRply *AttrSProcessEventReply
|
||||
evRply, err = alS.processEvent(args)
|
||||
if err != nil {
|
||||
if err != utils.ErrNotFound {
|
||||
err = utils.NewErrServerError(err)
|
||||
|
||||
Reference in New Issue
Block a user