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

This commit is contained in:
aforge
2023-02-04 17:58:56 -08:00
parent 9fb1551bef
commit 885d9932e2
9 changed files with 219 additions and 211 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.