Grafana UI: Unbind graph only if initialised (#25762)

pull/25763/head
Alex Khomenko 5 years ago committed by GitHub
parent 46df05fd9d
commit 1bde4de827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      packages/grafana-ui/src/components/Graph/Graph.tsx

@ -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 } }) => {

Loading…
Cancel
Save