From a9d397c5e18ffcf9e1eb0eccd51b782593b473de Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Mon, 8 Nov 2021 09:49:59 -0700 Subject: [PATCH] throw error if workspace is undefined (#1773) --- webapp/src/store/initialLoad.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webapp/src/store/initialLoad.ts b/webapp/src/store/initialLoad.ts index 39adc5cb6..3ad783641 100644 --- a/webapp/src/store/initialLoad.ts +++ b/webapp/src/store/initialLoad.ts @@ -22,6 +22,11 @@ export const initialLoad = createAsyncThunk( client.getAllBlocks(), getUserWorkspaces(), ]) + + // if no workspace, either bad id, or user doesn't have access + if (workspace === undefined) { + throw new Error('Workspace undefined') + } return { workspace, workspaceUsers,