fix: a null point exception
This commit is contained in:
parent
de34171fa2
commit
0e1fa4581a
@ -139,7 +139,7 @@ export class DocViewerComponent implements DoCheck, OnDestroy {
|
|||||||
@HostListener('click', ['$event'])
|
@HostListener('click', ['$event'])
|
||||||
toggleTranslationOrigin($event: MouseEvent): void {
|
toggleTranslationOrigin($event: MouseEvent): void {
|
||||||
const element = findTranslationResult($event.target as Element);
|
const element = findTranslationResult($event.target as Element);
|
||||||
if (element.hasAttribute('translation-result')) {
|
if (element && element.hasAttribute('translation-result')) {
|
||||||
const origin = element.nextElementSibling;
|
const origin = element.nextElementSibling;
|
||||||
if (!origin || origin.hasAttribute('translation-result') || origin.tagName !== element.tagName) {
|
if (!origin || origin.hasAttribute('translation-result') || origin.tagName !== element.tagName) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user