Skip to content

Commit

Permalink
[FIX] error checking causing panic (#103)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Takashi <[email protected]>
  • Loading branch information
nicolastakashi authored May 6, 2024
1 parent 631c4a4 commit 4b62434
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/alphacontrollers/alert_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ func flattenNotificationGroups(ctx context.Context, notificationGroups []*alerts
var err error
for _, ng := range notificationGroups {
notificationGroup, flattenErr := flattenNotificationGroup(ctx, ng)
if err != nil {
if flattenErr != nil {
err = stdErr.Join(err, fmt.Errorf("error on flatten notification-groups - %w", flattenErr))
continue
}
Expand Down Expand Up @@ -1018,6 +1018,7 @@ func flattenNotifications(ctx context.Context, notifications []*alerts.AlertNoti
flattenedNotification, flattenErr := flattenNotification(ctx, notification)
if flattenErr != nil {
err = stdErr.Join(err, fmt.Errorf("error on flatten notifications - %w", flattenErr))
continue
}
result = append(result, flattenedNotification)
}
Expand Down

0 comments on commit 4b62434

Please sign in to comment.