Skip to content

Commit

Permalink
feat: add protection
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
  • Loading branch information
SuZhou-Joe committed Mar 20, 2024
1 parent 3547286 commit 8350bef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plugins/workspace/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const renderFatalErrorApp = (params: AppMountParameters, services: Servic
const history = params.history as ScopedHistory<{ error?: string }>;
ReactDOM.render(
<OpenSearchDashboardsContextProvider services={services}>
<WorkspaceFatalError error={history.location.state.error} />
<WorkspaceFatalError error={history.location.state?.error} />
</OpenSearchDashboardsContextProvider>,
element
);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/workspace/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class WorkspacePlugin implements Plugin<{}, {}, {}> {
application.navigateToApp(WORKSPACE_FATAL_ERROR_APP_ID, {
replace: true,
state: {
error: result.error,
error: result?.error,
},
});
})();
Expand Down

0 comments on commit 8350bef

Please sign in to comment.