Skip to content

Commit

Permalink
Fix NPE when resolving state (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK authored Jul 7, 2023
1 parent 35f734f commit 226d208
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions stateresolutionv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ func ResolveStateConflictsV2(
panic(err)
}
}
if len(authEvents) > 0 {
roomID, err = spec.NewRoomID(authEvents[0].RoomID())
if err != nil {
panic(err)
}
}
// If we still don't have a roomID, we don't have conflicted, unconflicted
// or any authEvents, which in theory shouldn't happen.
if roomID == nil {
return r.result
}

r.allower = newAllowerContext(&r.authProvider, userIDForSender, *roomID)

Expand Down

0 comments on commit 226d208

Please sign in to comment.