From 8b2cebe093abd5b6d2c287bebe247df364bd262f Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Thu, 20 Oct 2016 17:47:56 -0700 Subject: [PATCH] =?UTF-8?q?lint(react):=20InlineImages=20don=E2=80=99t=20g?= =?UTF-8?q?et=20session=20at=20send-time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../composer/lib/inline-image-upload-container.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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);