mirror of
https://github.com/bjc/prosody.git
synced 2025-04-01 20:27:39 +03:00
util.error: Fix error on conversion of invalid error stanza, fix #1805
Error stanzas should have an <error> element, but if you pass a stanza without one to util.error.from_stanza() it triggers an attempt to index a nil value, which this patch avoids. In the conditional, it should be safe to assume error_tag is non-nil since condition can't have those values then.
This commit is contained in:
parent
506ee45da2
commit
57c3771614
1 changed files with 1 additions and 1 deletions
|
@ -141,7 +141,7 @@ local function from_stanza(stanza, context, source)
|
|||
local error_tag = stanza:get_child("error");
|
||||
context = context or {};
|
||||
context.stanza = stanza;
|
||||
context.by = error_tag.attr.by or stanza.attr.from;
|
||||
context.by = error_tag and error_tag.attr.by or stanza.attr.from;
|
||||
|
||||
local uri;
|
||||
if condition == "gone" or condition == "redirect" then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue