mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-27 05:49:04 +01:00
Check for map key before usage
This commit is contained in:
parent
6025bbdecd
commit
9df6184e02
@ -42,7 +42,9 @@ func setupRoutes(router *mux.Router, routes []Route) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
infos = route.Setup(infos, r)
|
infos = route.Setup(infos, r)
|
||||||
route.Title = strings.Replace(route.Title, "<ID>", infos["id"].(string), 1)
|
if id, ok := infos["id"]; ok {
|
||||||
|
route.Title = strings.Replace(route.Title, "<ID>", id.(string), 1)
|
||||||
|
}
|
||||||
|
|
||||||
templates.Render(rw, r, route.Template, &templates.Page{
|
templates.Render(rw, r, route.Template, &templates.Page{
|
||||||
Title: route.Title,
|
Title: route.Title,
|
||||||
|
Loading…
Reference in New Issue
Block a user