From 8254b594598797db621b0a6b260e55941ded7374 Mon Sep 17 00:00:00 2001 From: rozetko Date: Wed, 24 Jul 2019 16:46:32 +0300 Subject: [PATCH] Error: can't read property 'type' of undefined #353 (#367) --- src/panel/graph_panel/graph_ctrl.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/panel/graph_panel/graph_ctrl.ts b/src/panel/graph_panel/graph_ctrl.ts index abf2910..7ebe975 100644 --- a/src/panel/graph_panel/graph_ctrl.ts +++ b/src/panel/graph_panel/graph_ctrl.ts @@ -762,6 +762,9 @@ class GraphCtrl extends MetricsPanelCtrl { } private async _getDatasourceRequest() { + if(this._datasourceRequest === undefined) { + throw new Error('Datasource is not set. If it`s Grafana test-datasource - it`s not supported'); + } if(this._datasourceRequest.type === undefined) { const datasource = await this._getDatasourceByName(this.panel.datasource); if(datasource.access !== 'proxy') {