From b5f0ad00c668b624ed596e659e68c79773a540ea Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 3 Aug 2018 20:59:15 +0200 Subject: util.dataforms: Set default value for form type argument --- util/dataforms.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/dataforms.lua b/util/dataforms.lua index a5826d91..06b74886 100644 --- a/util/dataforms.lua +++ b/util/dataforms.lua @@ -26,7 +26,8 @@ local function new(layout) end function form_t.form(layout, data, formtype) - local form = st.stanza("x", { xmlns = xmlns_forms, type = formtype or "form" }); + if not formtype then formtype = "form" end + local form = st.stanza("x", { xmlns = xmlns_forms, type = formtype }); if layout.title then form:tag("title"):text(layout.title):up(); end -- cgit v1.2.3