nil guard

This commit is contained in:
Kegan Dougal 2020-09-01 11:45:30 +01:00
parent cd7ab95dfe
commit b32684caa8

View file

@ -176,6 +176,9 @@ func (r *RoomserverInternalAPI) isInvitePending(
if err != nil { if err != nil {
return false, "", "", fmt.Errorf("r.DB.RoomInfo: %w", err) return false, "", "", fmt.Errorf("r.DB.RoomInfo: %w", err)
} }
if info == nil {
return false, "", "", fmt.Errorf("cannot get RoomInfo: unknown room ID %s", roomID)
}
// Look up the state key NID for the supplied user ID. // Look up the state key NID for the supplied user ID.
targetUserNIDs, err := r.DB.EventStateKeyNIDs(ctx, []string{userID}) targetUserNIDs, err := r.DB.EventStateKeyNIDs(ctx, []string{userID})