Let's not crash when we don't have a unsigned - resolves #305

This commit is contained in:
David Teller 2022-06-09 08:06:12 +02:00
parent 0eea04bd69
commit 8ce269c512

View File

@ -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 // 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. // in order to mark a rule as deleted.
// We always set state with the normalised state type via `kind` to de-duplicate rules. // 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); this.setState(kind, event['state_key'], event);
const changeType: null|ChangeType = (() => { const changeType: null|ChangeType = (() => {
if (!previousState) { if (!previousState) {