Skip to content

Commit 13de837

Browse files
committed
Return early if tab or panel are undefined
1 parent 2f856f1 commit 13de837

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/tab-container-element.ts

+3
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ export class TabContainerElement extends HTMLElement {
362362
const selectedTab = tabs[index]
363363
const selectedPanel = panels[index]
364364

365+
if (!selectedTab) return
366+
if (!selectedPanel) return
367+
365368
if (this.#setupComplete) {
366369
const cancelled = !this.dispatchEvent(
367370
new TabContainerChangeEvent('tab-container-change', {

0 commit comments

Comments
 (0)