Fix bug with nil interface return & add test
This commit is contained in:
parent
345f025ee3
commit
027a9b8ce0
2 changed files with 38 additions and 1 deletions
|
|
@ -868,7 +868,11 @@ func (r *Queryer) QueryRoomInfo(ctx context.Context, roomID spec.RoomID) (*types
|
|||
}
|
||||
|
||||
func (r *Queryer) CurrentStateEvent(ctx context.Context, roomID spec.RoomID, eventType string, stateKey string) (gomatrixserverlib.PDU, error) {
|
||||
return r.DB.GetStateEvent(ctx, roomID.String(), string(eventType), "")
|
||||
res, err := r.DB.GetStateEvent(ctx, roomID.String(), string(eventType), "")
|
||||
if res == nil {
|
||||
return nil, err
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (r *Queryer) UserJoinedToRoom(ctx context.Context, roomNID types.RoomNID, userID spec.UserID) (bool, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue