diff --git a/queue/attempt.go b/queue/attempt.go index 0f5af9ce..171cc86c 100644 --- a/queue/attempt.go +++ b/queue/attempt.go @@ -234,8 +234,11 @@ func (a *Attempt) DistributeAgent(agent agent_manager.AgentObject) { wlog.Debug(fmt.Sprintf("attempt[%d] distribute agent %d", a.Id(), agent.Id())) } -func (a *Attempt) TeamUpdatedAt() *int64 { - return a.member.TeamUpdatedAt +func (a *Attempt) TeamUpdatedAt() int64 { + if a.member.TeamUpdatedAt == nil { + return 0 + } + return *a.member.TeamUpdatedAt } func (a *Attempt) Id() int64 { diff --git a/queue/queue.go b/queue/queue.go index c3f53401..c7344fa4 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -214,7 +214,7 @@ func (queue *BaseQueue) TeamManager() *teamManager { func (queue *BaseQueue) GetTeam(attempt *Attempt) (*agentTeam, *model.AppError) { if attempt.agent != nil { - return queue.TeamManager().GetTeam(attempt.agent.TeamId(), attempt.agent.TeamUpdatedAt()) + return queue.TeamManager().GetTeam(attempt.agent.TeamId(), attempt.TeamUpdatedAt()) } return nil, model.NewAppError("BaseQueue.GetTeam", "queue.team.get_by_id.app_error", nil, "Not found parameters", http.StatusInternalServerError)