diff --git a/change/@microsoft-fast-tooling-5e290551-ffbb-455f-9cc2-5b9f0d815f0f.json b/change/@microsoft-fast-tooling-5e290551-ffbb-455f-9cc2-5b9f0d815f0f.json new file mode 100644 index 0000000..39ee5c1 --- /dev/null +++ b/change/@microsoft-fast-tooling-5e290551-ffbb-455f-9cc2-5b9f0d815f0f.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Fixed HTMLRender error on empty markup", + "packageName": "@microsoft/fast-tooling", + "email": "44823142+williamw2@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/fast-tooling/src/web-components/html-render/html-render.ts b/packages/fast-tooling/src/web-components/html-render/html-render.ts index ee4f5eb..f694b68 100644 --- a/packages/fast-tooling/src/web-components/html-render/html-render.ts +++ b/packages/fast-tooling/src/web-components/html-render/html-render.ts @@ -469,9 +469,12 @@ export class HTMLRender extends FoundationElement { /// Render - private renderHtmlResolver = (config: ResolverConfig): HTMLElement | Text => { + private renderHtmlResolver = ( + config: ResolverConfig + ): HTMLElement | Text | null => { htmlResolver(config); if ( + config.dataDictionary[0][config.dictionaryId].data !== undefined && (config.dataDictionary[0][config.dictionaryId].data as HTMLElement) .setAttribute ) { @@ -485,8 +488,10 @@ export class HTMLRender extends FoundationElement { "taborder", (this.tabCounter++).toString() ); + return config.dataDictionary[0][config.dictionaryId].data; + } else { + return null; } - return config.dataDictionary[0][config.dictionaryId].data; }; public renderMarkup(): void {