diff mod_seclabels/mod_seclabels.lua @ 1310:2df312eb816d

mod_seclabels: Avoid tracebacks about indexing nil stanza
author Vadim Misbakh-Soloviov <mva@mva.name>
date Wed, 19 Feb 2014 17:59:17 +0700
parents 020b5944a973
children 7dbde05b48a9
line wrap: on
line diff
--- a/mod_seclabels/mod_seclabels.lua	Wed Feb 19 17:57:32 2014 +0700
+++ b/mod_seclabels/mod_seclabels.lua	Wed Feb 19 17:59:17 2014 +0700
@@ -11,8 +11,10 @@
 
 module:hook("account-disco-info", function(event) -- COMPAT
 	local stanza = event.stanza;
-	stanza:tag('feature', {var=xmlns_label}):up();
-	stanza:tag('feature', {var=xmlns_label_catalog}):up();
+	if stanza then
+		stanza:tag('feature', {var=xmlns_label}):up();
+		stanza:tag('feature', {var=xmlns_label_catalog}):up();
+	end;
 end);
 
 local default_labels = {