From 8ce269c512b2812445a4424091b5541b0cce1ce4 Mon Sep 17 00:00:00 2001 From: David Teller Date: Thu, 9 Jun 2022 08:06:12 +0200 Subject: [PATCH] Let's not crash when we don't have a unsigned - resolves #305 --- src/models/BanList.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/models/BanList.ts b/src/models/BanList.ts index 3b0d0a40..7fb47645 100644 --- a/src/models/BanList.ts +++ b/src/models/BanList.ts @@ -272,6 +272,10 @@ class BanList extends EventEmitter { // The reason we set the state at this point is because it is valid to want to set the state to an invalid rule // in order to mark a rule as deleted. // We always set state with the normalised state type via `kind` to de-duplicate rules. + if (!("unsigned" in event)) { + // We'll store stuff in `unsigned`, so let's make sure it exists! + event.unsigned = {}; + } this.setState(kind, event['state_key'], event); const changeType: null|ChangeType = (() => { if (!previousState) {