Fix nil map bugs (by initialising maps)

This commit is contained in:
Sam Wedgwood 2023-07-06 12:36:07 +01:00
parent 8642e69568
commit 8416059391
2 changed files with 4 additions and 1 deletions

View file

@ -34,7 +34,9 @@ type RoomHierarchyPaginationCache struct {
} }
func NewRoomHierarchyPaginationCache() RoomHierarchyPaginationCache { func NewRoomHierarchyPaginationCache() RoomHierarchyPaginationCache {
return RoomHierarchyPaginationCache{} return RoomHierarchyPaginationCache{
cache: map[string]roomserverAPI.CachedRoomHierarchyWalker{},
}
} }
func (c *RoomHierarchyPaginationCache) Get(token string) roomserverAPI.CachedRoomHierarchyWalker { func (c *RoomHierarchyPaginationCache) Get(token string) roomserverAPI.CachedRoomHierarchyWalker {

View file

@ -37,6 +37,7 @@ func (r *Queryer) QueryRoomHierarchy(ctx context.Context, caller types.DeviceOrS
parentRoomID: "", parentRoomID: "",
depth: 0, depth: 0,
}}, }},
processed: stringSet{},
} }
return &walker return &walker