admin: Fix nil dereference when asking password
This commit is contained in:
parent
ad41513654
commit
8fd2a70894
@ -73,7 +73,11 @@ func declareTeamsPasswordRoutes(router *gin.RouterGroup) {
|
||||
router.GET("/password", func(c *gin.Context) {
|
||||
team := c.MustGet("team").(*fic.Team)
|
||||
|
||||
c.String(http.StatusOK, *team.Password)
|
||||
if team.Password != nil {
|
||||
c.String(http.StatusOK, *team.Password)
|
||||
} else {
|
||||
c.AbortWithStatusJSON(http.StatusNotFound, nil)
|
||||
}
|
||||
})
|
||||
router.POST("/password", func(c *gin.Context) {
|
||||
team := c.MustGet("team").(*fic.Team)
|
||||
|
Loading…
Reference in New Issue
Block a user