Merge branch 'master' into neilalexander/federationinput

This commit is contained in:
Neil Alexander 2022-01-21 15:02:30 +00:00
commit 7a93bb32e7
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
29 changed files with 408 additions and 381 deletions

View file

@ -842,9 +842,13 @@ func (d *Database) GetStateEvent(ctx context.Context, roomID, evType, stateKey s
if err != nil {
return nil, err
}
if roomInfo == nil || roomInfo.IsStub {
if roomInfo == nil {
return nil, fmt.Errorf("room %s doesn't exist", roomID)
}
// e.g invited rooms
if roomInfo.IsStub {
return nil, nil
}
eventTypeNID, err := d.EventTypesTable.SelectEventTypeNID(ctx, nil, evType)
if err == sql.ErrNoRows {
// No rooms have an event of this type, otherwise we'd have an event type NID