瀏覽代碼

InfluxDB: Fix handling of empty array in templating variable query, Fixes #1298

Torkel Ödegaard 11 年之前
父節點
當前提交
63fa9f4535
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 3 0
      CHANGELOG.md
  2. 2 0
      src/app/features/influxdb/datasource.js

+ 3 - 0
CHANGELOG.md

@@ -4,6 +4,9 @@
 - [Issue #1297](https://github.com/grafana/grafana/issues/1297). Graphite: Added cumulative and minimumBelow graphite functions
 - [Issue #1297](https://github.com/grafana/grafana/issues/1297). Graphite: Added cumulative and minimumBelow graphite functions
 - [Issue #1296](https://github.com/grafana/grafana/issues/1296). InfluxDB: Auto escape column names with special characters. Thanks @steven-aerts
 - [Issue #1296](https://github.com/grafana/grafana/issues/1296). InfluxDB: Auto escape column names with special characters. Thanks @steven-aerts
 
 
+**Fixes**
+- [Issue #1298](https://github.com/grafana/grafana/issues/1298). InfluxDB: Fix handling of empty array in templating variable query
+
 # 1.9.1 (2014-12-29)
 # 1.9.1 (2014-12-29)
 
 
 **Enhancements**
 **Enhancements**

+ 2 - 0
src/app/features/influxdb/datasource.js

@@ -117,6 +117,8 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
 
 
       return this._seriesQuery(interpolated)
       return this._seriesQuery(interpolated)
         .then(function (results) {
         .then(function (results) {
+          if (!results || results.length === 0) { return []; }
+
           return _.map(results[0].points, function (metric) {
           return _.map(results[0].points, function (metric) {
             return {
             return {
               text: metric[1],
               text: metric[1],