fix mapping screen crash when office/resource is unknown
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user