Changeset

5481:169772e3d4e0

mod_pubsub: Only assign id to item element if there is one
author Matthew Wild <mwild1@gmail.com>
date Wed, 17 Apr 2013 14:32:26 +0100
parents 5479:81c599c7588b
children 5482:f2631a14b953
files plugins/mod_pubsub.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pubsub.lua	Wed Apr 17 14:12:47 2013 +0100
+++ b/plugins/mod_pubsub.lua	Wed Apr 17 14:32:26 2013 +0100
@@ -193,7 +193,9 @@
 	local id = (item and item.attr.id);
 	if not id then
 		id = uuid_generate();
-		item.attr.id = id;
+		if item then
+			item.attr.id = id;
+		end
 	end
 	local ok, ret = service:publish(node, stanza.attr.from, id, item);
 	local reply;