From a4d78f333f96d6a1fe08bdd66e1b7cdf1f0e124a Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 9 Mar 2010 18:19:50 +0500 Subject: mod_compression: More robust stanza processing. --- plugins/mod_compression.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua index bdecf467..379927df 100644 --- a/plugins/mod_compression.lua +++ b/plugins/mod_compression.lua @@ -47,7 +47,8 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc end -- checking if the compression method is supported - local method = stanza:child_with_name("method")[1]; + local method = stanza:child_with_name("method"); + method = method and method[1]; if method == "zlib" then -- create deflate and inflate streams local status, deflate_stream = pcall(zlib.deflate, compression_level); -- cgit v1.2.3