diff --git a/tensorboard/plugins/projector/vz_projector/vz-projector-bookmark-panel.ts b/tensorboard/plugins/projector/vz_projector/vz-projector-bookmark-panel.ts index a4a2e6b6ed1..70f924fd37d 100644 --- a/tensorboard/plugins/projector/vz_projector/vz-projector-bookmark-panel.ts +++ b/tensorboard/plugins/projector/vz_projector/vz-projector-bookmark-panel.ts @@ -197,9 +197,12 @@ class BookmarkPanel extends LegacyElementMixin(PolymerElement) { */ private getParentDataIndex(evt: Event) { for (let i = 0; i < (evt as any).path.length; i++) { - let dataIndex = (evt as any).path[i].getAttribute('data-index'); - if (dataIndex != null) { - return +dataIndex; + let elem = (evt as any).path[i]; + if (elem instanceof HTMLElement) { + let dataIndex = elem.getAttribute('data-index'); + if (dataIndex != null) { + return +dataIndex; + } } } return -1;