Prevent exception on page unload

Null check when saving sent history
pull/21833/head
David Baker 2017-07-13 11:30:25 +01:00
parent 4cc8b5621d
commit 1e80edb43c
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ export default class MessageComposer extends React.Component {
}
onPageUnload(event) {
if (this.messageComposerInput) {
if (this.messageComposerInput && this.messageComposerInput.sentHistory) {
this.messageComposerInput.sentHistory.saveLastTextEntry();
}
}