diff --git a/client/src/scenes/RoomOfficeNameMapping/components/SingleMapping.js b/client/src/scenes/RoomOfficeNameMapping/components/SingleMapping.js index 2e7d36d..61daa4a 100644 --- a/client/src/scenes/RoomOfficeNameMapping/components/SingleMapping.js +++ b/client/src/scenes/RoomOfficeNameMapping/components/SingleMapping.js @@ -76,67 +76,71 @@ class SingleMapping extends Component { }; render() { - const { singleMapping: { officeSlug, resourceSlug } } = this.props; - const { officeId, resourceId, officeOptions, allResourceOptions, pendingMappings } = this.props; - const { showDeletePrompt, newOfficeId, newResourceId } = this.state; + try { + const {singleMapping: {officeSlug, resourceSlug}} = this.props; + const {officeId, resourceId, officeOptions, allResourceOptions, pendingMappings} = this.props; + const {showDeletePrompt, newOfficeId, newResourceId} = this.state; - const selectedOfficeId = newOfficeId ? newOfficeId : officeId; - const selectedResourceId = newResourceId ? newResourceId : resourceId; + const selectedOfficeId = newOfficeId ? newOfficeId : officeId; + const selectedResourceId = newResourceId ? newResourceId : resourceId; - const resourceOptions = allResourceOptions && officeId ? allResourceOptions[selectedOfficeId].roomOptions : []; + const resourceOptions = allResourceOptions && officeId ? allResourceOptions[selectedOfficeId].roomOptions : []; - const enableActions = !pendingMappings; - const enableSave = enableActions && ((newOfficeId !== null) || (newResourceId !== null)); - const saveIconColor = enableSave ? 'green' : null; + const enableActions = !pendingMappings; + const enableSave = enableActions && ((newOfficeId !== null) || (newResourceId !== null)); + const saveIconColor = enableSave ? 'green' : null; - return ( - - - - - - - + - - - - - - - - - - ); + + + + + + + + + + + + + + + ); + }catch (e) { + return null; + } } }