diff --git a/aio/src/app/layout/doc-viewer/doc-viewer.component.ts b/aio/src/app/layout/doc-viewer/doc-viewer.component.ts index 0aafede7a6..5b2a055a25 100644 --- a/aio/src/app/layout/doc-viewer/doc-viewer.component.ts +++ b/aio/src/app/layout/doc-viewer/doc-viewer.component.ts @@ -139,7 +139,7 @@ export class DocViewerComponent implements DoCheck, OnDestroy { @HostListener('click', ['$event']) toggleTranslationOrigin($event: MouseEvent): void { const element = findTranslationResult($event.target as Element); - if (element.hasAttribute('translation-result')) { + if (element && element.hasAttribute('translation-result')) { const origin = element.nextElementSibling; if (!origin || origin.hasAttribute('translation-result') || origin.tagName !== element.tagName) { return;