diff --git a/packages/grafana-ui/src/components/Graph/Graph.tsx b/packages/grafana-ui/src/components/Graph/Graph.tsx index 16e3286c083..9495fa1096f 100644 --- a/packages/grafana-ui/src/components/Graph/Graph.tsx +++ b/packages/grafana-ui/src/components/Graph/Graph.tsx @@ -70,7 +70,9 @@ export class Graph extends PureComponent { } 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 } }) => {