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

Commit 4b0df21

Browse files
authored
Fix null-guarding regression around reply_to_event dispatch (#8039)
1 parent 5262d5c commit 4b0df21

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/structures/RoomView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
844844
case 'reply_to_event':
845845
if (!this.unmounted &&
846846
this.state.searchResults &&
847-
payload.event.getRoomId() === this.state.roomId &&
847+
payload.event?.getRoomId() === this.state.roomId &&
848848
payload.context === TimelineRenderingType.Search
849849
) {
850850
this.onCancelSearchClick();

src/stores/RoomViewStore.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class RoomViewStore extends Store<ActionPayload> {
201201
// this can happen when performing a search across all rooms. Persist the data from this event for
202202
// both room and search timeline rendering types, search will get auto-closed by RoomView at this time.
203203
if ([TimelineRenderingType.Room, TimelineRenderingType.Search].includes(payload.context)) {
204-
if (payload.event?.getRoomId() !== this.state.roomId) {
204+
if (payload.event && payload.event.getRoomId() !== this.state.roomId) {
205205
dis.dispatch<ViewRoomPayload>({
206206
action: Action.ViewRoom,
207207
room_id: payload.event.getRoomId(),

0 commit comments

Comments
 (0)