File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
site/src/pages/ManagementSettingsPage Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { getErrorMessage } from "api/errors";
8
8
import { groups } from "api/queries/groups" ;
9
9
import { organizationPermissions } from "api/queries/organizations" ;
10
10
import type { Organization } from "api/typesGenerated" ;
11
+ import { EmptyState } from "components/EmptyState/EmptyState" ;
11
12
import { displayError } from "components/GlobalSnackbar/utils" ;
12
13
import { Loader } from "components/Loader/Loader" ;
13
14
import { PageHeader , PageHeaderTitle } from "components/PageHeader/PageHeader" ;
@@ -56,7 +57,11 @@ export const GroupsPage: FC = () => {
56
57
return < Navigate to = { `/organizations/${ defaultName } /groups` } replace /> ;
57
58
}
58
59
// We expect there to always be a default organization.
59
- throw new Error ( "No default organization found" )
60
+ throw new Error ( "No default organization found" ) ;
61
+ }
62
+
63
+ if ( ! organization ) {
64
+ return < EmptyState message = "Organization not found" /> ;
60
65
}
61
66
62
67
const permissions = permissionsQuery . data ;
Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ const OrganizationSettingsPage: FC = () => {
47
47
if ( defaultOrg ) {
48
48
return < Navigate to = { `/organizations/${ defaultOrg . name } ` } replace /> ;
49
49
}
50
- return < EmptyState message = "No default organization found" /> ;
50
+ // We expect there to always be a default organization.
51
+ throw new Error ( "No default organization found" ) ;
51
52
}
52
53
53
54
if ( ! organization ) {
You can’t perform that action at this time.
0 commit comments