Software /
code /
prosody
Diff
plugins/mod_pubsub.lua @ 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 |
parent | 5479:81c599c7588b |
child | 5569:c45997aebaa2 |
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;