mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-19 03:11:40 +02:00
Check for map key before usage
This commit is contained in:
@@ -42,7 +42,9 @@ func setupRoutes(router *mux.Router, routes []Route) {
|
||||
}
|
||||
|
||||
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{
|
||||
Title: route.Title,
|
||||
|
Reference in New Issue
Block a user