Skip to content

Commit

Permalink
Merge pull request #361 from ca-risken/fix-bug
Browse files Browse the repository at this point in the history
fix: nil deriference
  • Loading branch information
gassara-kys committed Jun 4, 2024
2 parents 3900380 + 075dc73 commit 685857a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/server/alert/alert_notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ func (a *AlertService) RequestProjectRoleNotification(ctx context.Context, req *
if err != nil {
return nil, err
}
if notifications == nil || len(*notifications) == 0 {
return nil, fmt.Errorf("notification not found. project_id: %d", req.ProjectId)
}
notification := (*notifications)[0]
projects, err := a.projectClient.ListProject(ctx, &project.ListProjectRequest{ProjectId: req.ProjectId})
if err != nil {
Expand Down

0 comments on commit 685857a

Please sign in to comment.