diff --git a/internal_packages/composer/lib/inline-image-upload-container.jsx b/internal_packages/composer/lib/inline-image-upload-container.jsx index 86272192e..c938272c8 100644 --- a/internal_packages/composer/lib/inline-image-upload-container.jsx +++ b/internal_packages/composer/lib/inline-image-upload-container.jsx @@ -11,8 +11,8 @@ export default class InlineImageUploadContainer extends Component { static propTypes = { draft: PropTypes.object.isRequired, - session: PropTypes.object.isRequired, uploadId: PropTypes.string.isRequired, + session: PropTypes.object, isPreview: PropTypes.bool, } @@ -21,6 +21,10 @@ export default class InlineImageUploadContainer extends Component { } _onGoEdit = () => { + if (!this.props.session) { + console.warn("InlineImage editor cannot be activated, `session` prop not present. (isPreview?)") + return; + } // This is just a fun temporary hack because I was jealous of Apple Mail. // const el = ReactDOM.findDOMNode(this);