[v11.0.x] SSE: Fix threshold unmarshal to avoid panic (#88651)

SSE: Fix threshold unmarshal to avoid panic (#88521)

(cherry picked from commit 043e19afb5)

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-06-04 08:55:21 -04:00
committed by GitHub
co-authored by Yuri Tseretyan
parent 0ff6442e45
commit 0f436c5bdf
+1 -1
View File
@@ -92,10 +92,10 @@ func UnmarshalThresholdCommand(rn *rawNode, features featuremgmt.FeatureToggles)
}
if firstCondition.UnloadEvaluator != nil && features.IsEnabledGlobally(featuremgmt.FlagRecoveryThreshold) {
unloading, err := NewThresholdCommand(rn.RefID, referenceVar, firstCondition.UnloadEvaluator.Type, firstCondition.UnloadEvaluator.Params)
unloading.Invert = true
if err != nil {
return nil, fmt.Errorf("invalid unloadCondition: %w", err)
}
unloading.Invert = true
var d Fingerprints
if firstCondition.LoadedDimensions != nil {
d, err = FingerprintsFromFrame(firstCondition.LoadedDimensions)