diff --git a/pkg/services/ngalert/provisioning/alert_rules.go b/pkg/services/ngalert/provisioning/alert_rules.go index cbe638d2276..b673be172f0 100644 --- a/pkg/services/ngalert/provisioning/alert_rules.go +++ b/pkg/services/ngalert/provisioning/alert_rules.go @@ -467,6 +467,10 @@ func (service *AlertRuleService) GetAlertGroupsWithFolderTitle(ctx context.Conte namespaces[r.NamespaceUID] = append(namespaces[r.NamespaceUID], &groupKey) } + if len(namespaces) == 0 { + return []models.AlertRuleGroupWithFolderTitle{}, nil + } + dq := dashboards.GetDashboardsQuery{ DashboardUIDs: nil, }