mirror of https://github.com/vector-im/riot-web
Fixup: dont assume there is a prior edit
parent
14caed62d0
commit
3fd96008c3
|
@ -206,7 +206,7 @@ export default class MessageEditor extends React.Component {
|
||||||
_cancelPreviousPendingEdit() {
|
_cancelPreviousPendingEdit() {
|
||||||
const originalEvent = this.props.editState.getEvent();
|
const originalEvent = this.props.editState.getEvent();
|
||||||
const previousEdit = originalEvent.replacingEvent();
|
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);
|
this.context.matrixClient.cancelPendingEvent(previousEdit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue