Add protection in case of nil arguments for cgr-console for PostprocessRpcParams fixes #1642

This commit is contained in:
TeoV
2019-08-01 10:36:20 +03:00
committed by Dan Christian Bogos
parent 48d966e0c6
commit cae07d1e35
14 changed files with 29 additions and 16 deletions

View File

@@ -58,7 +58,8 @@ func (self *CmdSessionsProcessEvent) RpcParams(reset bool) interface{} {
}
func (self *CmdSessionsProcessEvent) PostprocessRpcParams() error {
if self.rpcParams.CGREvent.Time == nil {
if self.rpcParams != nil && self.rpcParams.CGREvent != nil &&
self.rpcParams.CGREvent.Time == nil {
self.rpcParams.CGREvent.Time = utils.TimePointer(time.Now())
}
return nil