diff --git a/server/handlers/movie.go b/server/handlers/movie.go index b020dea..dd52ad1 100644 --- a/server/handlers/movie.go +++ b/server/handlers/movie.go @@ -344,6 +344,10 @@ func ProxyMovie(ctx *gin.Context) { return } id, err := strconv.ParseUint(roomId, 10, 64) + if err != nil { + ctx.AbortWithStatusJSON(http.StatusBadRequest, model.NewApiErrorResp(err)) + return + } room, err := op.GetRoomByID(uint(id)) if err != nil { ctx.AbortWithStatusJSON(http.StatusBadRequest, model.NewApiErrorResp(err)) diff --git a/server/handlers/room.go b/server/handlers/room.go index 8fefda8..c5e0bc9 100644 --- a/server/handlers/room.go +++ b/server/handlers/room.go @@ -180,6 +180,10 @@ func RoomList(ctx *gin.Context) { func CheckRoom(ctx *gin.Context) { id, err := strconv.Atoi(ctx.Query("roomId")) + if err != nil { + ctx.AbortWithStatusJSON(http.StatusBadRequest, model.NewApiErrorResp(err)) + return + } r, err := op.GetRoomByID(uint(id)) if err != nil {