Commit bd8a04a6 by Marcus Efraimsson Committed by GitHub

InfluxDB: Fix invalid memory address or nil pointer dereference when schema is…

InfluxDB: Fix invalid memory address or nil pointer dereference when schema is missing in URL (#25565)

Add guard if parsing url fails in influxdb backend data source.

Fixes #25242
parent 4c8ad8d0
......@@ -141,7 +141,10 @@ func (e *InfluxDBExecutor) getQuery(dsInfo *models.DataSource, queries []*tsdb.Q
func (e *InfluxDBExecutor) createRequest(dsInfo *models.DataSource, query string) (*http.Request, error) {
u, _ := url.Parse(dsInfo.Url)
u, err := url.Parse(dsInfo.Url)
if err != nil {
return nil, err
}
u.Path = path.Join(u.Path, "query")
httpMode := dsInfo.JsonData.Get("httpMode").MustString("GET")
......
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