diff --git a/public/app/features/trails/DataTrail.tsx b/public/app/features/trails/DataTrail.tsx index e3150253c69..8375c23e3ba 100644 --- a/public/app/features/trails/DataTrail.tsx +++ b/public/app/features/trails/DataTrail.tsx @@ -169,6 +169,11 @@ export class DataTrail extends SceneObjectBase { public restoreFromHistoryStep(state: DataTrailState) { this.disableUrlSync(); + if (!state.topScene && !state.metric) { + // If the top scene for an is missing, correct it. + state.topScene = new MetricSelectScene({}); + } + this.setState( sceneUtils.cloneSceneObjectState(state, { history: this.state.history, @@ -213,7 +218,7 @@ export class DataTrail extends SceneObjectBase { if (this.state.metric !== values.metric) { Object.assign(stateUpdate, this.getSceneUpdatesForNewMetricValue(values.metric)); } - } else if (values.metric === null) { + } else if (values.metric == null) { stateUpdate.metric = undefined; stateUpdate.topScene = new MetricSelectScene({}); }