aboutsummaryrefslogtreecommitdiffstats
path: root/util/stanza.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-25 20:44:05 +0100
committerKim Alvefur <zash@zash.se>2019-11-25 20:44:05 +0100
commitb9875e5501fe7ab32465e4677a9f35b064be5099 (patch)
tree603e11e382185e757035e937142d1c8e03c45e87 /util/stanza.lua
parente7c738ba3f21dce52cf4efe1bd0bbb7393d099cd (diff)
downloadprosody-b9875e5501fe7ab32465e4677a9f35b064be5099.tar.gz
prosody-b9875e5501fe7ab32465e4677a9f35b064be5099.zip
util.stanza: Check that argument to reply is a stanza
Diffstat (limited to 'util/stanza.lua')
-rw-r--r--util/stanza.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 55c38c73..f46d5b30 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -434,6 +434,9 @@ local function iq(attr)
end
local function reply(orig)
+ if not is_stanza(orig) then
+ error("bad argument to reply: expected stanza, got "..type(orig));
+ end
return new_stanza(orig.name,
orig.attr and {
to = orig.attr.from,