Don't return 500s on checking to see if a remote server is allowed to see an event we don't know about (#1490)

main
Neil Alexander 2020-10-07 10:30:27 +01:00 committed by GitHub
parent 0f7e707f39
commit f7c15071de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,8 @@ package helpers
import ( import (
"context" "context"
"database/sql"
"errors"
"fmt" "fmt"
"github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/roomserver/api"
@ -217,6 +219,9 @@ func CheckServerAllowedToSeeEvent(
roomState := state.NewStateResolution(db, info) roomState := state.NewStateResolution(db, info)
stateEntries, err := roomState.LoadStateAtEvent(ctx, eventID) stateEntries, err := roomState.LoadStateAtEvent(ctx, eventID)
if err != nil { if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return false, nil
}
return false, err return false, err
} }