mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: Fix exception being thrown when toggling visibility in explore (#60159)
fix error being thrown when frameIndex is out of bounds of dataframe
This commit is contained in:
parent
b71ae13b63
commit
b0f8e803a1
@ -119,8 +119,8 @@ export const getVisibleLabels = (config: UPlotConfigBuilder, frames: DataFrame[]
|
||||
const fieldIndex = plotInstance.props?.dataFrameFieldIndex?.fieldIndex;
|
||||
|
||||
if (frameIndex !== undefined && fieldIndex !== undefined) {
|
||||
const field = frames[frameIndex].fields[fieldIndex];
|
||||
if (field.labels) {
|
||||
const field = frames[frameIndex]?.fields[fieldIndex];
|
||||
if (field?.labels) {
|
||||
// Note that this may be an empty object in the case of a metric being rendered with no labels
|
||||
visibleLabels.push({
|
||||
labels: field.labels,
|
||||
|
Loading…
Reference in New Issue
Block a user