K8s: Dashboards: Only get folder if exists on dashboard (#101017)

This commit is contained in:
Stephanie Hingtgen authored and GitHub committed 2025-02-20 00:40:05 +02:00
1 parent 55aaf4aac0
commit 146af8f2be
1 file changed
+1 -1
@@ -366,7 +366,7 @@ func (dr *DashboardServiceImpl) BuildSaveDashboardCommand(ctx context.Context, d
}
// Validate folder
if dr.features.IsEnabledGlobally(featuremgmt.FlagKubernetesClientDashboardsFolders) {
if dr.features.IsEnabledGlobally(featuremgmt.FlagKubernetesClientDashboardsFolders) && (dash.FolderID != 0 || dash.FolderUID != "") { // nolint:staticcheck
folder, err := dr.folderService.Get(ctx, &folder.GetFolderQuery{
OrgID: dash.OrgID,
UID: &dash.FolderUID,