Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Add a bit of safety around timestamp handling for threads (#8845)
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live authored Jun 15, 2022
1 parent 39f2bba commit 44b2667
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/views/rooms/EventTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1121,9 +1121,13 @@ export class UnwrappedEventTile extends React.Component<IProps, IState> {
|| Boolean(this.state.contextMenu));

// Thread panel shows the timestamp of the last reply in that thread
const ts = this.context.timelineRenderingType !== TimelineRenderingType.ThreadsList
let ts = this.context.timelineRenderingType !== TimelineRenderingType.ThreadsList
? this.props.mxEvent.getTs()
: this.state.thread?.replyToEvent.getTs();
: this.state.thread?.replyToEvent?.getTs();
if (typeof ts !== "number") {
// Fall back to something we can use
ts = this.props.mxEvent.getTs();
}

const messageTimestamp = <MessageTimestamp
showRelative={this.context.timelineRenderingType === TimelineRenderingType.ThreadsList}
Expand Down

0 comments on commit 44b2667

Please sign in to comment.