Merge s2s branch
[prosody.git] / plugins / mod_pubsub.lua
index 4d3911bb85fae5dd9cf7c88d88565507c9e941f7..22969ab5f067d9fee54364c8ffc933d9fcf6bb99 100644 (file)
@@ -193,7 +193,9 @@ function handlers.set_publish(origin, stanza, publish)
        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;