Procházet zdrojové kódy

fix(): A Datasource with null jsonData would make Grafana fail to load page, fixes #4536

Torkel Ödegaard před 9 roky
rodič
revize
a2c6469d41
2 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 1 0
      CHANGELOG.md
  2. 1 1
      pkg/api/frontendsettings.go

+ 1 - 0
CHANGELOG.md

@@ -2,6 +2,7 @@
 
 
 ### Bug fixes
 ### Bug fixes
 * **Dashboard**: Fixed dashboard panel layout for mobile devices, fixes [#4529](https://github.com/grafana/grafana/issues/4529)
 * **Dashboard**: Fixed dashboard panel layout for mobile devices, fixes [#4529](https://github.com/grafana/grafana/issues/4529)
+* **Page Load Crash**: A Datasource with null jsonData would make Grafana fail to load page, fixes [#4536](https://github.com/grafana/grafana/issues/4536)
 
 
 # 3.0.0-beta1 (2016-03-31)
 # 3.0.0-beta1 (2016-03-31)
 
 

+ 1 - 1
pkg/api/frontendsettings.go

@@ -59,7 +59,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
 			defaultDatasource = ds.Name
 			defaultDatasource = ds.Name
 		}
 		}
 
 
-		if len(ds.JsonData.MustMap()) > 0 {
+		if ds.JsonData != nil {
 			dsMap["jsonData"] = ds.JsonData
 			dsMap["jsonData"] = ds.JsonData
 		}
 		}