aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2021-06-21 09:41:12 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2021-06-21 09:41:12 +0100
commit5357df36c9adc6de24653f181a5d3a5070a23ce2 (patch)
treeea4794b6a7cf9953123fc97f7761865d29c2fcdc
parent3a77bca28b520668d5a4ce8d596f99bc4974a4af (diff)
Fix panic in roomserver
-rw-r--r--roomserver/storage/shared/storage.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/roomserver/storage/shared/storage.go b/roomserver/storage/shared/storage.go
index 096d5d7a..e77d62e0 100644
--- a/roomserver/storage/shared/storage.go
+++ b/roomserver/storage/shared/storage.go
@@ -156,7 +156,7 @@ func (d *Database) AddState(
stateBlockNIDs []types.StateBlockNID,
state []types.StateEntry,
) (stateNID types.StateSnapshotNID, err error) {
- if len(stateBlockNIDs) > 0 {
+ if len(stateBlockNIDs) > 0 && len(state) > 0 {
// Check to see if the event already appears in any of the existing state
// blocks. If it does then we should not add it again, as this will just
// result in excess state blocks and snapshots.