Commit d0e705c1 authored by Stefan Dähling's avatar Stefan Dähling
Browse files

check if mas exists before creating heatmap

parent a13d7941
Pipeline #531787 passed with stages
in 3 minutes and 20 seconds
...@@ -443,6 +443,10 @@ func (stor *localStorage) getAgentLogSeries(masID int, agentID int, name string, ...@@ -443,6 +443,10 @@ func (stor *localStorage) getAgentLogSeries(masID int, agentID int, name string,
func (stor *localStorage) getMsgHeatmap(masID int, start time.Time, end time.Time) (heatmap map[[2]int]int, err error) { func (stor *localStorage) getMsgHeatmap(masID int, start time.Time, end time.Time) (heatmap map[[2]int]int, err error) {
heatmap = make(map[[2]int]int) heatmap = make(map[[2]int]int)
stor.mutex.Lock() stor.mutex.Lock()
if masID >= len(stor.mas) {
stor.mutex.Unlock()
return
}
for agentID := 0; agentID < len(stor.mas[masID].agents); agentID++ { for agentID := 0; agentID < len(stor.mas[masID].agents); agentID++ {
length := len(stor.mas[masID].agents[agentID].msgLogs) length := len(stor.mas[masID].agents[agentID].msgLogs)
if length > 0 { if length > 0 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment