diff --git a/ui/src/CheckSources.tsx b/ui/src/CheckSources.tsx index 1e56ec3713..f80ec6ba3f 100644 --- a/ui/src/CheckSources.tsx +++ b/ui/src/CheckSources.tsx @@ -139,7 +139,7 @@ export class CheckSources extends Component { } if ( - me.superAdmin && + _.get(me, 'superAdmin', false) && !organizations.find(o => o.id === currentOrganization.id) ) { notify(copy.notifyUserRemovedFromCurrentOrg()) @@ -192,13 +192,11 @@ export class CheckSources extends Component { const { params, sources, - auth: { - isUsingAuth, - me: {currentOrganization}, - }, + auth: {isUsingAuth, me}, } = this.props const {isFetching} = this.state const source = sources.find(s => s.id === params.sourceID) + const currentOrganization = _.get(me, 'currentOrganization') if (isFetching || !source || (isUsingAuth && !currentOrganization)) { return