Commit ef08a243 by bergquist

fix(influxdb): fixes possible nil pointer

closes #6531
parent 6a813890
...@@ -12,7 +12,6 @@ type InfluxdbQueryParser struct{} ...@@ -12,7 +12,6 @@ type InfluxdbQueryParser struct{}
func (qp *InfluxdbQueryParser) Parse(model *simplejson.Json, dsInfo *tsdb.DataSourceInfo) (*Query, error) { func (qp *InfluxdbQueryParser) Parse(model *simplejson.Json, dsInfo *tsdb.DataSourceInfo) (*Query, error) {
policy := model.Get("policy").MustString("default") policy := model.Get("policy").MustString("default")
rawQuery := model.Get("query").MustString("") rawQuery := model.Get("query").MustString("")
interval := model.Get("interval").MustString("")
measurement := model.Get("measurement").MustString("") measurement := model.Get("measurement").MustString("")
...@@ -36,7 +35,8 @@ func (qp *InfluxdbQueryParser) Parse(model *simplejson.Json, dsInfo *tsdb.DataSo ...@@ -36,7 +35,8 @@ func (qp *InfluxdbQueryParser) Parse(model *simplejson.Json, dsInfo *tsdb.DataSo
return nil, err return nil, err
} }
if interval == "" { interval := model.Get("interval").MustString("")
if interval == "" && dsInfo.JsonData != nil {
dsInterval := dsInfo.JsonData.Get("timeInterval").MustString("") dsInterval := dsInfo.JsonData.Get("timeInterval").MustString("")
if dsInterval != "" { if dsInterval != "" {
interval = dsInterval interval = dsInterval
......
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