core.stanza_router: Verify that xmlns exists for firing stanza/iq/xmlns/name events (fixes #1022) (thanks SamWhited)
authorKim Alvefur <zash@zash.se>
Tue, 17 Oct 2017 07:09:00 +0200
changeset 8350 c72db8047440
parent 8296 34814a908557
child 8351 c3de5b454ec4
core.stanza_router: Verify that xmlns exists for firing stanza/iq/xmlns/name events (fixes #1022) (thanks SamWhited)
core/stanza_router.lua
--- a/core/stanza_router.lua	Thu Oct 05 17:44:47 2017 +0200
+++ b/core/stanza_router.lua	Tue Oct 17 07:09:00 2017 +0200
@@ -140,7 +140,8 @@
 		if h then
 			local event;
 			if xmlns == nil then
-				if stanza.name == "iq" and (stanza.attr.type == "set" or stanza.attr.type == "get") then
+				if stanza.name == "iq" and (stanza.attr.type == "set" or stanza.attr.type == "get")
+					and stanza.tags[1] and stanza.tags[1].attr.xmlns then
 					event = "stanza/iq/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name;
 				else
 					event = "stanza/"..stanza.name;