mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
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
This commit is contained in:
parent
4c8ad8d031
commit
bd8a04a6a5
@ -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")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user