Require at least one element in interactive dialogs (#10003)

Этот коммит содержится в:
Joram Wilander
2018-12-14 10:30:07 -05:00
коммит произвёл Carlos Tadeu Panato Junior
родитель c06e42b24a
Коммит 6c2e216c3f
2 изменённых файлов: 18 добавлений и 22 удалений

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

@@ -59,6 +59,11 @@ func openDialog(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if dialog.Dialog.Elements == nil || len(dialog.Dialog.Elements) == 0 {
c.SetInvalidParam("dialog.elements")
return
}
if err := c.App.OpenInteractiveDialog(dialog); err != nil {
c.Err = err
return