From 37344a42d84600131eda7709965c29c57787ab81 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Fri, 8 Jun 2018 17:06:21 +0200
Subject: util.stanza: Verify that other objects added as children are valid
 strings

---
 util/stanza.lua | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/util/stanza.lua b/util/stanza.lua
index 6453be48..2691cb0b 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -137,8 +137,11 @@ end
 function stanza_mt:add_direct_child(child)
 	if is_stanza(child) then
 		t_insert(self.tags, child);
+		t_insert(self, child);
+	else
+		check_text(child, "text");
+		t_insert(self, child);
 	end
-	t_insert(self, child);
 end
 
 function stanza_mt:add_child(child)
-- 
cgit v1.2.3