Handle invalid query in graph UI (#2652)

This commit is contained in:
Conor Broderick 2017-04-24 10:50:57 +01:00 committed by Brian Brazil
parent 8b8ba26129
commit 9eb1a5d6bf
2 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -415,7 +415,7 @@ Prometheus.Graph.prototype.submitQuery = function() {
return;
}
var duration = new Date().getTime() - startTime;
var totalTimeSeries = xhr.responseJSON.data.result.length;
var totalTimeSeries = (xhr.responseJSON.data !== undefined) ? xhr.responseJSON.data.result.length : 0;
self.evalStats.html("Load time: " + duration + "ms <br /> Resolution: " + resolution + "s <br />" + "Total time series: " + totalTimeSeries);
self.spinner.hide();
}