From 6298d3d7cd1d419e5df7d60895d6982256469bc3 Mon Sep 17 00:00:00 2001 From: Alexander Velikiy <39257464+VargBurz@users.noreply.github.com> Date: Fri, 28 Feb 2020 12:10:45 +0300 Subject: [PATCH] TypeError: Cannot read property 'isUp' of undefined #398 (#416) --- src/panel/graph_panel/graph_ctrl.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/panel/graph_panel/graph_ctrl.ts b/src/panel/graph_panel/graph_ctrl.ts index 2536750..95fd7cd 100644 --- a/src/panel/graph_panel/graph_ctrl.ts +++ b/src/panel/graph_panel/graph_ctrl.ts @@ -338,11 +338,21 @@ class GraphCtrl extends MetricsPanelCtrl { this._analyticUnitsToShow ); - if(this.analyticService.isUp) { - await this.analyticsController.init(); + if(this.analyticService === undefined) { + appEvents.emit( + 'alert-error', + [ + 'Select Hastic datasource', + 'Panel config -> Visualization' + ] + ); + } else { + if(this.analyticService.isUp) { + await this.analyticsController.init(); - this._updatePanelInfo(); - this.analyticsController.updateServerInfo(); + this._updatePanelInfo(); + this.analyticsController.updateServerInfo(); + } } this._graphRenderer = new GraphRenderer(