aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/stanza.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index d16fc947..4a0a9ce8 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -111,9 +111,11 @@ function stanza_mt:tag(name, attr, namespaces)
end
function stanza_mt:text(text)
- check_text(text, "text");
- local last_add = self.last_add;
- (last_add and last_add[#last_add] or self):add_direct_child(text);
+ if text ~= nil and text ~= "" then
+ check_text(text, "text");
+ local last_add = self.last_add;
+ (last_add and last_add[#last_add] or self):add_direct_child(text);
+ end
return self;
end