From d204c7a17cd0a4feb7ac51f76439bd7440dba5bd Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:23:59 +0100 Subject: [PATCH] Server may still be nil --- roomserver/internal/query/query_room_hierarchy.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/roomserver/internal/query/query_room_hierarchy.go b/roomserver/internal/query/query_room_hierarchy.go index 6af86c3b5..6a7ec1d14 100644 --- a/roomserver/internal/query/query_room_hierarchy.go +++ b/roomserver/internal/query/query_room_hierarchy.go @@ -199,9 +199,11 @@ func (querier *Queryer) QueryNextRoomHierarchyPage(ctx context.Context, walker r func authorised(ctx context.Context, querier *Queryer, caller types.DeviceOrServerName, roomID spec.RoomID, parentRoomID *spec.RoomID) (authed, isJoinedOrInvited bool) { if clientCaller := caller.Device(); clientCaller != nil { return authorisedUser(ctx, querier, clientCaller, roomID, parentRoomID) - } else { - return authorisedServer(ctx, querier, roomID, *caller.ServerName()), false } + if serverCaller := caller.ServerName(); serverCaller != nil { + return authorisedServer(ctx, querier, roomID, *serverCaller), false + } + return false, false } // authorisedServer returns true iff the server is joined this room or the room is world_readable, public, or knockable