Skip to content

Commit

Permalink
fix null access
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay committed Oct 3, 2024
1 parent 17d6ad4 commit 2c18370
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/integration/mentionSpamProtectionTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ describe("Test: Mention spam protection", function () {
const mentionDisplaynames = Array.from({length: DEFAULT_MAX_MENTIONS+1}, (_, i) => `Test User ${i}`);

// Pre-set the displayname cache.
this.mjolnir.protectionManager.protections.roomDisplaynameCache.set(room, mentionDisplaynames);
let protection = this.mjolnir.protectionManager.protections.get('MentionSpam')
protection.roomDisplaynameCache.set(room, mentionDisplaynames);

const messageWithTextMentions = await client.sendText(room, mentionUsers.join(' '));
const messageWithHTMLMentions = await client.sendHtmlText(room,
Expand All @@ -93,7 +94,6 @@ describe("Test: Mention spam protection", function () {
});
const messageWithDisplaynameMentions = await client.sendText(room, mentionDisplaynames.join(' '));


await delay(500);

const fetchedTextEvent = await client.getEvent(room, messageWithTextMentions);
Expand Down

0 comments on commit 2c18370

Please sign in to comment.