Do not crash in MessagesView.handleMessageUpdate if topic gets unset.

This commit is contained in:
aforge
2023-02-06 09:51:53 -08:00
committed by or-else
parent f755314c3b
commit fc6a8fbafc
9 changed files with 1877 additions and 2027 deletions
+3
View File
@@ -672,6 +672,9 @@ class MessagesView extends React.Component {
// The 'msg' could be false-ish if some message ranges were deleted.
handleMessageUpdate(msg) {
if (!this.state.topic) {
return;
}
const topic = this.props.tinode.getTopic(this.state.topic);
if (!msg) {
// msg could be null if one or more messages were deleted.