diff --git a/ui/src/CheckSources.tsx b/ui/src/CheckSources.tsx index 67083c15d..c6213ff2b 100644 --- a/ui/src/CheckSources.tsx +++ b/ui/src/CheckSources.tsx @@ -1,9 +1,11 @@ import React, {ReactElement, Component} from 'react' +import _ from 'lodash' import PropTypes from 'prop-types' import {withRouter, InjectedRouter} from 'react-router' import {Location} from 'history' import {connect} from 'react-redux' import {bindActionCreators} from 'redux' +import {ErrorHandling} from 'src/shared/decorators/errors' import { isUserAuthorized, @@ -52,6 +54,7 @@ interface Props { // Acts as a 'router middleware'. The main `App` component is responsible for // getting the list of data sources, but not every page requires them to function. // Routes that do require data sources can be nested under this component. +@ErrorHandling export class CheckSources extends Component { public static childContextTypes = { source: PropTypes.shape({ @@ -111,9 +114,11 @@ export class CheckSources extends Component { params, errorThrown, sources, - auth: {isUsingAuth, me, me: {organizations = [], currentOrganization}}, + auth: {isUsingAuth, me}, notify, } = nextProps + const organizations = _.get(me, 'organizations', []) + const currentOrganization = _.get(me, 'currentOrganization') const {isFetching} = nextState const source = sources.find(s => s.id === params.sourceID) const defaultSource = sources.find(s => s.default === true)