From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Mon, 31 Mar 2025 21:52:43 +0200
Subject: [PATCH] lua-xml: Fix lua tests

---
 src/lua-factory/lua-library/lua-xml.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/lua-factory/lua-library/lua-xml.c b/src/lua-factory/lua-library/lua-xml.c
index b4031d8096fe..46690306f865 100644
--- a/src/lua-factory/lua-library/lua-xml.c
+++ b/src/lua-factory/lua-library/lua-xml.c
@@ -124,10 +124,12 @@ build_table_from_xml_reader (lua_State  *L,
 
   str = xmlNodeListGetString (doc, parent->xmlChildrenNode, 1);
   if (str) {
-    /* We use xml to the value as it is a forbidden node name */
-    lua_pushstring (L, "xml");
-    lua_pushstring (L, (gchar *) str);
-    lua_settable(L, -3);
+    if (*str) {
+      /* We use xml to the value as it is a forbidden node name */
+      lua_pushstring (L, "xml");
+      lua_pushstring (L, (gchar *) str);
+      lua_settable(L, -3);
+    }
     xmlFree (str);
   }
 
