mod_pep: Fixed a nil access error
authorWaqas Hussain <waqas20@gmail.com>
Sun, 28 Jun 2009 17:23:06 +0000 (22:23 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Sun, 28 Jun 2009 17:23:06 +0000 (22:23 +0500)
plugins/mod_pep.lua

index 78098423c64fb67a25ade0b93c7aa42921f17c51..4a8300f1d0fc8600bc7021b54658ddff63b25ac6 100644 (file)
@@ -33,8 +33,10 @@ local function publish(session, node, item)
        -- store for the future
        local user_data = data[bare];
        if disable then
        -- store for the future
        local user_data = data[bare];
        if disable then
-               if user_data then user_data[node] = nil; end
-               if not next(user_data) then data[bare] = nil; end
+               if user_data then
+                       user_data[node] = nil;
+                       if not next(user_data) then data[bare] = nil; end
+               end
        else
                if not user_data then user_data = {}; data[bare] = user_data; end
                user_data[node] = stanza;
        else
                if not user_data then user_data = {}; data[bare] = user_data; end
                user_data[node] = stanza;