From 0e1fa4581af9a3996112f14d1c9e6c5390a603ff Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Mon, 21 Aug 2017 09:05:59 +0800 Subject: [PATCH] fix: a null point exception --- aio/src/app/layout/doc-viewer/doc-viewer.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;