diff --git a/src/file/table-of-contents/sdt-properties.ts b/src/file/table-of-contents/sdt-properties.ts index f1f2c56304..998167d22a 100644 --- a/src/file/table-of-contents/sdt-properties.ts +++ b/src/file/table-of-contents/sdt-properties.ts @@ -2,8 +2,10 @@ import { StringValueElement, XmlComponent } from "@file/xml-components"; export class StructuredDocumentTagProperties extends XmlComponent { - public constructor(alias: string) { + public constructor(alias?: string) { super("w:sdtPr"); - this.root.push(new StringValueElement("w:alias", alias)); + if(typeof alias === 'string'){ + this.root.push(new StringValueElement("w:alias", alias)); + } } }