Skip to content

Commit 8007daf

Browse files
authored
fix: do now throw when panel does not exist (#116)
1 parent e941749 commit 8007daf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/api-viewer-tabs.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,10 @@ export class ApiViewerTabs extends LitElement {
179179
this.reset();
180180

181181
const newPanel = this._panelForTab(newTab);
182-
if (!newPanel) {
183-
throw new Error('No panel with for tab');
182+
if (newPanel) {
183+
newTab.selected = true;
184+
newPanel.hidden = false;
184185
}
185-
newTab.selected = true;
186-
newPanel.hidden = false;
187186
}
188187

189188
private _onKeyDown(event: KeyboardEvent): void {

0 commit comments

Comments
 (0)