From 16156b0b0988e7b1746b2834e6357c3c90bc8465 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 25 Aug 2022 09:51:36 +0100 Subject: Fix 500s on `/state`, `/state_ids` when state not known (#2672) This was due to bad error bubbling. --- federationapi/routing/join.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'federationapi/routing/join.go') diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index b48eaf78..1a121987 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -329,6 +329,12 @@ func SendJoin( JSON: jsonerror.NotFound("Room does not exist"), } } + if !stateAndAuthChainResponse.StateKnown { + return util.JSONResponse{ + Code: http.StatusForbidden, + JSON: jsonerror.Forbidden("State not known"), + } + } // Check if the user is already in the room. If they're already in then // there isn't much point in sending another join event into the room. -- cgit v1.2.3