mod_measure_stanza_counts: Fix a crash in mod_bosh.
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Mon, 09 Oct 2017 19:22:39 +0100
changeset 2792 512405077709
parent 2791 750572f6f59d
child 2793 37ae0801f925
mod_measure_stanza_counts: Fix a crash in mod_bosh.
mod_measure_stanza_counts/mod_measure_stanza_counts.lua
--- a/mod_measure_stanza_counts/mod_measure_stanza_counts.lua	Mon Oct 09 20:15:33 2017 +0200
+++ b/mod_measure_stanza_counts/mod_measure_stanza_counts.lua	Mon Oct 09 19:22:39 2017 +0100
@@ -8,7 +8,7 @@
 	return function (stanza, session)
 		measures[dir]();
 		measures[dir .. "_" .. session.type]();
-		if not stanza.attr.xmlns and stanza_kinds[stanza.name] then
+		if stanza.attr and not stanza.attr.xmlns and stanza_kinds[stanza.name] then
 			measures[dir .. "_" .. session.type .. "_" .. stanza.name]();
 		end
 		return stanza;