Hotfix for Explore (empty page after running query)

Since #13212 adhoc filters are being gathered, in Explore the template
  service has no variables set and then throws when iterating over them.
This commit is contained in:
David Kaltschmidt 2018-09-14 16:09:43 +02:00
parent 270b736302
commit 1a38c45dde

View File

@ -50,6 +50,7 @@ export class TemplateSrv {
getAdhocFilters(datasourceName) {
let filters = [];
if (this.variables) {
for (let i = 0; i < this.variables.length; i++) {
const variable = this.variables[i];
if (variable.type !== 'adhoc') {
@ -65,6 +66,7 @@ export class TemplateSrv {
}
}
}
}
return filters;
}