diff --git a/src/components/views/elements/MessageEditor.js b/src/components/views/elements/MessageEditor.js index 194c2d4a67..0a3d6443d9 100644 --- a/src/components/views/elements/MessageEditor.js +++ b/src/components/views/elements/MessageEditor.js @@ -206,7 +206,7 @@ export default class MessageEditor extends React.Component { _cancelPreviousPendingEdit() { const originalEvent = this.props.editState.getEvent(); const previousEdit = originalEvent.replacingEvent(); - if (previousEdit.status === EventStatus.QUEUED || previousEdit.status === EventStatus.NOT_SENT) { + if (previousEdit && (previousEdit.status === EventStatus.QUEUED || previousEdit.status === EventStatus.NOT_SENT)) { this.context.matrixClient.cancelPendingEvent(previousEdit); } }