Skip to content

Commit

Permalink
handleActiveTabClose does nothing if no tab exists (#936)
Browse files Browse the repository at this point in the history
  • Loading branch information
avatus committed Jun 29, 2022
1 parent c1fb2e6 commit bf960d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/packages/teleterm/src/ui/TabHost/useTabShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ function buildTabsShortcuts(
};

const handleActiveTabClose = () => {
const { uri } = documentService.getActive();
documentService.close(uri);
const activeDocument = documentService.getActive();
if (activeDocument) {
documentService.close(activeDocument.uri);
}
};

const handleTabSwitch = (direction: 'previous' | 'next') => () => {
Expand Down

0 comments on commit bf960d5

Please sign in to comment.