Skip to content

Commit ef08a24

Browse files
committed
fix(influxdb): fixes possible nil pointer
closes grafana#6531
1 parent 6a81389 commit ef08a24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/tsdb/influxdb/model_parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ type InfluxdbQueryParser struct{}
1212
func (qp *InfluxdbQueryParser) Parse(model *simplejson.Json, dsInfo *tsdb.DataSourceInfo) (*Query, error) {
1313
policy := model.Get("policy").MustString("default")
1414
rawQuery := model.Get("query").MustString("")
15-
interval := model.Get("interval").MustString("")
1615

1716
measurement := model.Get("measurement").MustString("")
1817

@@ -36,7 +35,8 @@ func (qp *InfluxdbQueryParser) Parse(model *simplejson.Json, dsInfo *tsdb.DataSo
3635
return nil, err
3736
}
3837

39-
if interval == "" {
38+
interval := model.Get("interval").MustString("")
39+
if interval == "" && dsInfo.JsonData != nil {
4040
dsInterval := dsInfo.JsonData.Get("timeInterval").MustString("")
4141
if dsInterval != "" {
4242
interval = dsInterval

0 commit comments

Comments
 (0)