mirror of
				https://github.com/ClusterCockpit/cc-backend
				synced 2025-11-04 01:25:06 +01:00 
			
		
		
		
	fix potential crash cause due to index oor on empty ccms return
This commit is contained in:
		@@ -207,9 +207,9 @@ func (ccms *CCMetricStore) LoadData(
 | 
				
			|||||||
			jobData[metric] = make(map[schema.MetricScope]*schema.JobMetric)
 | 
								jobData[metric] = make(map[schema.MetricScope]*schema.JobMetric)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		res := row[0].Resolution
 | 
							res := mc.Timestep
 | 
				
			||||||
		if res == 0 {
 | 
							if len(row) > 0 {
 | 
				
			||||||
			res = mc.Timestep
 | 
								res = row[0].Resolution
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		jobMetric, ok := jobData[metric][scope]
 | 
							jobMetric, ok := jobData[metric][scope]
 | 
				
			||||||
@@ -784,9 +784,9 @@ func (ccms *CCMetricStore) LoadNodeListData(
 | 
				
			|||||||
		scope := assignedScope[i]
 | 
							scope := assignedScope[i]
 | 
				
			||||||
		mc := archive.GetMetricConfig(cluster, metric)
 | 
							mc := archive.GetMetricConfig(cluster, metric)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		res := row[0].Resolution
 | 
							res := mc.Timestep
 | 
				
			||||||
		if res == 0 {
 | 
							if len(row) > 0 {
 | 
				
			||||||
			res = mc.Timestep
 | 
								res = row[0].Resolution
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Init Nested Map Data Structures If Not Found
 | 
							// Init Nested Map Data Structures If Not Found
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user