fix mapping screen crash when office/resource is unknown

This commit is contained in:
Bilal Catic
2019-11-20 13:45:54 +01:00
parent fcb71a3f00
commit eff96f9e5e

View File

@@ -76,9 +76,10 @@ class SingleMapping extends Component {
}; };
render() { render() {
const { singleMapping: { officeSlug, resourceSlug } } = this.props; try {
const { officeId, resourceId, officeOptions, allResourceOptions, pendingMappings } = this.props; const {singleMapping: {officeSlug, resourceSlug}} = this.props;
const { showDeletePrompt, newOfficeId, newResourceId } = this.state; const {officeId, resourceId, officeOptions, allResourceOptions, pendingMappings} = this.props;
const {showDeletePrompt, newOfficeId, newResourceId} = this.state;
const selectedOfficeId = newOfficeId ? newOfficeId : officeId; const selectedOfficeId = newOfficeId ? newOfficeId : officeId;
const selectedResourceId = newResourceId ? newResourceId : resourceId; const selectedResourceId = newResourceId ? newResourceId : resourceId;
@@ -137,6 +138,9 @@ class SingleMapping extends Component {
</Table.Cell> </Table.Cell>
</Table.Row> </Table.Row>
); );
}catch (e) {
return null;
}
} }
} }