Explorar o código

xmlelem: fix add xmlelem

Martin Kunz hai 1 mes
pai
achega
56a918ca7e
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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;
     }