Fix panic if JSON null value is passed as channel update (#23629)

Этот коммит содержится в:
Ben Schumacher
2023-06-05 19:16:47 +02:00
коммит произвёл GitHub
родитель 9c656c25d9
Коммит 3705d7af4d
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@@ -125,7 +125,7 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) {
var channel *model.Channel
err := json.NewDecoder(r.Body).Decode(&channel)
if err != nil {
if err != nil || channel == nil {
c.SetInvalidParamWithErr("channel", err)
return
}