From 84d70f5a48afc3b7c7f541d837754dbdc5f4188c Mon Sep 17 00:00:00 2001 From: andronache Date: Tue, 13 Apr 2021 15:37:05 +0300 Subject: [PATCH] Fixed bug in utils/cgrevent.go --- utils/cgrevent.go | 2 +- utils/cgrevent_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/cgrevent.go b/utils/cgrevent.go index 716342692..546793b58 100644 --- a/utils/cgrevent.go +++ b/utils/cgrevent.go @@ -97,7 +97,7 @@ func (ev *CGREvent) FieldAsDuration(fldName string) (d time.Duration, err error) // OptAsDuration returns an option as Duration instance func (ev *CGREvent) OptAsDuration(optName string) (d time.Duration, err error) { - iface, has := ev.Event[optName] + iface, has := ev.APIOpts[optName] if !has { err = ErrNotFound return diff --git a/utils/cgrevent_test.go b/utils/cgrevent_test.go index c247a8b29..1d08265c4 100644 --- a/utils/cgrevent_test.go +++ b/utils/cgrevent_test.go @@ -510,7 +510,7 @@ func TestCGREventOptAsDurationEmpty(t *testing.T) { func TestCGREventOptAsDuration(t *testing.T) { ev := &CGREvent{ - Event: map[string]interface{}{ + APIOpts: map[string]interface{}{ "testKey": 30, }, }