Commit 7c88436a by Marcus Efraimsson Committed by GitHub

Merge pull request #13133 from grafana/13132_query_variable

Fix error when new variables created but not yet added/saved
parents cab6861d 1e74d7f2
......@@ -122,12 +122,13 @@ export class VariableSrv {
}
const g = this.createGraph();
const promises = g
.getNode(variable.name)
.getOptimizedInputEdges()
.map(e => {
const node = g.getNode(variable.name);
let promises = [];
if (node) {
promises = node.getOptimizedInputEdges().map(e => {
return this.updateOptions(this.variables.find(v => v.name === e.inputNode.name));
});
}
return this.$q.all(promises).then(() => {
if (emitChangeEvents) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment