datatrails: quick bugfix: handle undefined step (#87337)

fix: handle undefined step
This commit is contained in:
Darren Janeczek
2024-05-03 19:22:23 +03:00
committed by GitHub
parent 1d6d5cc2cd
commit 6524febbd4
+4 -2
View File
@@ -94,8 +94,10 @@ export class DataTrail extends SceneObjectBase<DataTrailState> {
}
// Disconnects the current step history state from the current state, to prevent changes affecting history state
const currentState = this.state.history.state.steps[this.state.history.state.currentStep].trailState;
this.restoreFromHistoryStep(currentState);
const currentState = this.state.history.state.steps[this.state.history.state.currentStep]?.trailState;
if (currentState) {
this.restoreFromHistoryStep(currentState);
}
this.enableUrlSync();