Browse Source

xmlelem: fix add xmlelem

Martin Kunz 1 month ago
parent
commit
56a918ca7e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/util/XmlElem.ts

+ 3 - 1
src/util/XmlElem.ts

@@ -26,8 +26,10 @@ export class XMLElem {
     public elem(name:string, value: XMLElem|string|boolean|undefined|null): XMLElem {
         if(value===undefined||value===null)
             return this; //skip undefined/null values
-        if(value instanceof XMLElem)
+        if(value instanceof XMLElem) {
             this.elements.push(value);
+            return this;
+        }
         this.elements.push(new XMLElem(name, value?.toString()));
         return this;
     }