From 646b52a75acbfccd126e2ac33e31d0b0cf7323c0 Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Mon, 28 Jan 2019 01:18:05 +0100 Subject: [PATCH] _getDatasourceByName null check --- src/module.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/module.ts b/src/module.ts index 512e8a5..bdbf761 100644 --- a/src/module.ts +++ b/src/module.ts @@ -614,6 +614,9 @@ class GraphCtrl extends MetricsPanelCtrl { } private async _getDatasourceByName(name: string) { + if(name === null) { + throw new Error('Trying to get datasource with NULL name'); + } if(this._datasources[name] === undefined) { const datasource = await this.backendSrv.get(`/api/datasources/name/${name}`); return datasource;