# HG changeset patch # User Matthew Wild # Date 1366205546 -3600 # Node ID 169772e3d4e034c48a0b5507323c2427a0d968bc # Parent 81c599c7588b30fddcd167fc72854a3bdf2dc1b1 mod_pubsub: Only assign id to item element if there is one diff -r 81c599c7588b -r 169772e3d4e0 plugins/mod_pubsub.lua --- 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;