This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
src/components/views/rooms Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -1255,16 +1255,14 @@ export default class MessageComposerInput extends React.Component {
1255
1255
1256
1256
let editorState ;
1257
1257
const historyItem = this . historyManager . getItem ( delta ) ;
1258
- if ( historyItem ) {
1259
- if ( historyItem . format === 'rich' && ! this . state . isRichTextEnabled ) {
1260
- editorState = this . richToMdEditorState ( historyItem . value ) ;
1261
- }
1262
- else if ( historyItem . format === 'markdown' && this . state . isRichTextEnabled ) {
1263
- editorState = this . mdToRichEditorState ( historyItem . value ) ;
1264
- }
1265
- else {
1266
- editorState = historyItem . value ;
1267
- }
1258
+ if ( ! historyItem ) return ;
1259
+
1260
+ if ( historyItem . format === 'rich' && ! this . state . isRichTextEnabled ) {
1261
+ editorState = this . richToMdEditorState ( historyItem . value ) ;
1262
+ } else if ( historyItem . format === 'markdown' && this . state . isRichTextEnabled ) {
1263
+ editorState = this . mdToRichEditorState ( historyItem . value ) ;
1264
+ } else {
1265
+ editorState = historyItem . value ;
1268
1266
}
1269
1267
1270
1268
// Move selection to the end of the selected history
You can’t perform that action at this time.
0 commit comments