aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-03-02 00:50:54 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-03-02 00:50:54 +0500
commit675aab41f91a524d114f43ded53569f9496197f2 (patch)
tree926098ca53a900ed9dad4c97b8397ea03b39d6a9 /util
parentc91f1d749438074f54d27352a74971034e1b2a3a (diff)
downloadprosody-675aab41f91a524d114f43ded53569f9496197f2.tar.gz
prosody-675aab41f91a524d114f43ded53569f9496197f2.zip
util.stanza: Fixed nil global accesses.
Diffstat (limited to 'util')
-rw-r--r--util/stanza.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 065888d0..ad982d42 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -247,14 +247,14 @@ function deserialize(stanza)
for i=1,#attr do attr[i] = nil; end
local attrx = {};
for att in pairs(attr) do
- if s_find(att, "|", 1, true) and not s_find(k, "\1", 1, true) then
- local ns,na = s_match(k, "^([^|]+)|(.+)$");
+ if s_find(att, "|", 1, true) and not s_find(att, "\1", 1, true) then
+ local ns,na = s_match(att, "^([^|]+)|(.+)$");
attrx[ns.."\1"..na] = attr[att];
attr[att] = nil;
end
end
for a,v in pairs(attrx) do
- attr[x] = v;
+ attr[a] = v;
end
setmetatable(stanza, stanza_mt);
for _, child in ipairs(stanza) do