admin: Fix nil pointer when seeing public team
This commit is contained in:
parent
159672ec47
commit
9ea415b857
@ -109,7 +109,10 @@ func declareTeamsRoutes(router *gin.RouterGroup) {
|
|||||||
c.JSON(http.StatusOK, tfile)
|
c.JSON(http.StatusOK, tfile)
|
||||||
})
|
})
|
||||||
apiTeamsPublicRoutes.GET("/stats.json", func(c *gin.Context) {
|
apiTeamsPublicRoutes.GET("/stats.json", func(c *gin.Context) {
|
||||||
team := c.MustGet("team").(*fic.Team)
|
var team *fic.Team
|
||||||
|
if t, ok := c.Get("team"); ok && t != nil {
|
||||||
|
team = t.(*fic.Team)
|
||||||
|
}
|
||||||
if team != nil {
|
if team != nil {
|
||||||
stats, err := team.GetStats()
|
stats, err := team.GetStats()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user