Grafana UI: Unbind graph only if initialised (#25762)
This commit is contained in:
@@ -70,7 +70,9 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.$element.unbind('plotselected', this.onPlotSelected);
|
||||
if (this.$element) {
|
||||
this.$element.unbind('plotselected', this.onPlotSelected);
|
||||
}
|
||||
}
|
||||
|
||||
onPlotSelected = (event: JQueryEventObject, ranges: { xaxis: { from: number; to: number } }) => {
|
||||
|
||||
Reference in New Issue
Block a user