Added non-error return to func GetStateEvent when no state events with the specified state key are found

This commit is contained in:
DavidSpenler 2021-06-22 22:04:53 -04:00
parent a4c9b785c2
commit f99185815f

View file

@ -866,6 +866,10 @@ func (d *Database) GetStateEvent(ctx context.Context, roomID, evType, stateKey s
return nil, err
}
stateKeyNID, err := d.EventStateKeysTable.SelectEventStateKeyNID(ctx, nil, stateKey)
if err == sql.ErrNoRows {
// No rooms a state event with this state key, otherwise we'd have an state key NID
return nil, nil
}
if err != nil {
return nil, err
}