Fix unmarshal of double pointer (#47586) (#47607)

* Fix unmaarshal of double pointer

* update sdk version

(cherry picked from commit 0bf889e058)

Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-04-12 09:42:56 +02:00
committed by GitHub
co-authored by ying-jeanne
parent be54ab63cb
commit bd76bd0d0e
9 changed files with 20 additions and 15 deletions
+2 -1
View File
@@ -453,9 +453,10 @@ func (hs *HTTPServer) GetHomeDashboard(c *models.ReqContext) response.Response {
dash.Meta.IsHome = true
dash.Meta.CanEdit = c.SignedInUser.HasRole(models.ROLE_EDITOR)
dash.Meta.FolderTitle = "General"
dash.Dashboard = simplejson.New()
jsonParser := json.NewDecoder(file)
if err := jsonParser.Decode(&dash.Dashboard); err != nil {
if err := jsonParser.Decode(dash.Dashboard); err != nil {
return response.Error(500, "Failed to load home dashboard", err)
}
+2 -2
View File
@@ -1115,8 +1115,8 @@ func restoreDashboardVersionScenario(t *testing.T, desc string, url string, rout
}
func (sc *scenarioContext) ToJSON() *simplejson.Json {
var result *simplejson.Json
err := json.NewDecoder(sc.resp.Body).Decode(&result)
result := simplejson.New()
err := json.NewDecoder(sc.resp.Body).Decode(result)
require.NoError(sc.t, err)
return result
}