Skip to content

Commit

Permalink
go reports-service: Fix nulls in incident sources
Browse files Browse the repository at this point in the history
  • Loading branch information
XxRoloxX committed Dec 1, 2024
1 parent e90b48c commit 4c7d4a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/services/reports/pkg/incident_correlation/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func ConvertConcreteIncidentArrayIntoIncidents[T repositories.Incident](incident

// Removes merged incidents from report and returns new incident as a result
func mergeApplicationIncidents(group IncidentMergeGroup, applicationIncidents *repositories.ApplicationReport) *repositories.ApplicationIncident {
var sourcesToBeMerged []repositories.ApplicationIncidentSource
var filteredIncidents []*repositories.ApplicationIncident
sourcesToBeMerged := make([]repositories.ApplicationIncidentSource, 0)
filteredIncidents := make([]*repositories.ApplicationIncident, 0)

if len(applicationIncidents.Incidents) == 0 {
panic("Empty list of incidents from a application report was passed to an incident merger")
Expand Down Expand Up @@ -63,8 +63,8 @@ func MergeApplicationIncidentsByGroups(groups []IncidentMergeGroup, applicationI

// Removes merged incidents from report and returns new incident as a result
func mergeNodeIncidents(group IncidentMergeGroup, nodeIncidents *repositories.NodeReport) *repositories.NodeIncident {
var sourcesToBeMerged []repositories.NodeIncidentSource
var filteredIncidents []*repositories.NodeIncident
sourcesToBeMerged := make([]repositories.NodeIncidentSource, 0)
filteredIncidents := make([]*repositories.NodeIncident, 0)

if len(nodeIncidents.Incidents) == 0 {
panic("Empty list of incidents from a node report was passed to an incident merger")
Expand Down

0 comments on commit 4c7d4a4

Please sign in to comment.