1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-04 05:02:41 +03:00

Add a catastrophic throw to thread constructor (#2375)

This is an attempt to narrow down https://github.com/vector-im/element-web/issues/22141
This commit is contained in:
Travis Ralston
2022-05-17 00:20:41 -06:00
committed by GitHub
parent e9e8e90a94
commit c6af997542
2 changed files with 34 additions and 0 deletions

View File

@@ -79,6 +79,12 @@ export class Thread extends TypedEventEmitter<EmittedEvents, EventHandlerMap> {
) {
super();
if (!opts?.room) {
// Logging/debugging for https://github.com/vector-im/element-web/issues/22141
// Hope is that we end up with a more obvious stack trace.
throw new Error("element-web#22141: A thread requires a room in order to function");
}
this.room = opts.room;
this.client = opts.client;
this.timelineSet = new EventTimelineSet(this.room, {