Skip to content

Commit 7fe93d7

Browse files
craig[bot]maryliag
andcommitted
108460: ui: fix crash when adminUI is not yet initialized r=maryliag a=maryliag When it's the first time a cluster is open, the value for adminUI might not yet be initialized. We should check before using it. This commit adds the check to a few missing places. Epic: none Release note: None Co-authored-by: maryliag <[email protected]>
2 parents 1fd3eb8 + b279482 commit 7fe93d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsConnected.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const mapStateToProps = (
4545
props: RouteComponentProps,
4646
): DatabaseDetailsPageData => {
4747
const database = getMatchParamByName(props.match, databaseNameCCAttr);
48-
const databaseDetails = state.adminUI.databaseDetails;
48+
const databaseDetails = state.adminUI?.databaseDetails;
4949
const dbTables =
5050
databaseDetails[database]?.data?.results.tablesResp.tables || [];
5151
const nodeRegions = nodeRegionsByIDSelector(state);

pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.selectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import moment from "moment-timezone";
1616

1717
export const statementDiagnostics = createSelector(
1818
(state: AppState) => state.adminUI,
19-
state => state.statementDiagnostics,
19+
state => state?.statementDiagnostics,
2020
);
2121

2222
export const selectStatementDiagnosticsReports = createSelector(

0 commit comments

Comments
 (0)