Skip to content

Commit

Permalink
CB-4634 fix: throw an error if result group was not found
Browse files Browse the repository at this point in the history
  • Loading branch information
s.teleshev committed Feb 23, 2024
1 parent e9b3669 commit d2af519
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface Props {

export const SqlResultSetPanel = observer<Props>(function SqlResultSetPanel({ state, resultTab }) {
const sqlQueryResultService = useService(SqlQueryResultService);
const group = state.resultGroups.find(group => group.groupId === resultTab.groupId)!;
const group = state.resultGroups.find(group => group.groupId === resultTab.groupId);

function onPresentationChange(presentationId: string) {
sqlQueryResultService.updateResultTab(state, resultTab.tabId, {
Expand All @@ -35,6 +35,10 @@ export const SqlResultSetPanel = observer<Props>(function SqlResultSetPanel({ st
});
}

if (!group) {
throw new Error('Result group not found');
}

return (
<TableViewerLoader
className={style.tableViewerLoader}
Expand Down

0 comments on commit d2af519

Please sign in to comment.