0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-14 09:43:48 +01:00

Prevent index out of bounds error (#503)

This commit is contained in:
Andrew Morgan 2018-06-18 04:03:08 -07:00 committed by GitHub
parent 93b7b18646
commit 06338b06d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,7 +130,7 @@ func (s *eventStateKeyStatements) bulkSelectEventStateKeyNID(
func (s *eventStateKeyStatements) bulkSelectEventStateKey(
ctx context.Context, eventStateKeyNIDs []types.EventStateKeyNID,
) (map[types.EventStateKeyNID]string, error) {
var nIDs pq.Int64Array
nIDs := make(pq.Int64Array, len(eventStateKeyNIDs))
for i := range eventStateKeyNIDs {
nIDs[i] = int64(eventStateKeyNIDs[i])
}