# HG changeset patch
# User Waqas Hussain <waqas20@gmail.com>
# Date 1268140790 -18000
# Node ID ae72c0dd6f1f597abdbdaf1447eb035912e4aa5c
# Parent  6807f5fa0eb48fb20cb08c95fa9f2d90da170803
mod_compression: More robust stanza processing.

diff -r 6807f5fa0eb4 -r ae72c0dd6f1f plugins/mod_compression.lua
--- a/plugins/mod_compression.lua	Tue Mar 09 18:11:45 2010 +0500
+++ b/plugins/mod_compression.lua	Tue Mar 09 18:19:50 2010 +0500
@@ -47,7 +47,8 @@
 			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);