diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 7da0b754076..589947af73b 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -705,9 +705,9 @@ export default class MessagePanel extends React.Component { let willWantDateSeparator = false; let lastInSection = true; - if (nextEvent) { - willWantDateSeparator = this.wantsDateSeparator(mxEv, nextEvent.getDate() || new Date()); - lastInSection = willWantDateSeparator || mxEv.getSender() !== nextEvent.getSender(); + if (nextEventWithTile) { + willWantDateSeparator = this.wantsDateSeparator(mxEv, nextEventWithTile.getDate() || new Date()); + lastInSection = willWantDateSeparator || mxEv.getSender() !== nextEventWithTile.getSender(); } // is this a continuation of the previous message?