Skip to content

Commit

Permalink
Listing no lobbies should return an empty array. (#70)
Browse files Browse the repository at this point in the history
When no lobbies are available for a game when listing lobbies the API
used to return `null`, this change makes that an empty array instead
`[]`.


Fixes #68
  • Loading branch information
koenbollen authored Nov 7, 2023
1 parent 44d18db commit fe42e9b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/signaling/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ func (p *Peer) HandleListPacket(ctx context.Context, packet ListPacket) error {
if err != nil {
return err
}
if lobbies == nil {
lobbies = []stores.Lobby{}
}
return p.Send(ctx, LobbiesPacket{
RequestID: packet.RequestID,
Type: "lobbies",
Expand Down

0 comments on commit fe42e9b

Please sign in to comment.