Fixup: dont assume there is a prior edit

pull/21833/head
Bruno Windels 2019-07-02 17:34:07 +02:00
parent 14caed62d0
commit 3fd96008c3
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}
}