admin: Fix nil dereference when asking password
This commit is contained in:
parent
ad41513654
commit
8fd2a70894
1 changed files with 5 additions and 1 deletions
|
|
@ -73,7 +73,11 @@ func declareTeamsPasswordRoutes(router *gin.RouterGroup) {
|
||||||
router.GET("/password", func(c *gin.Context) {
|
router.GET("/password", func(c *gin.Context) {
|
||||||
team := c.MustGet("team").(*fic.Team)
|
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) {
|
router.POST("/password", func(c *gin.Context) {
|
||||||
team := c.MustGet("team").(*fic.Team)
|
team := c.MustGet("team").(*fic.Team)
|
||||||
|
|
|
||||||
Reference in a new issue