Skip to content

fix: set lobby to null on disconnect and prevent selecting lobby out of bounds#92

Open
jonandrewdavis wants to merge 1 commit intofoxssake:mainfrom
jonandrewdavis:fix-lobby-select-after-disconnect
Open

fix: set lobby to null on disconnect and prevent selecting lobby out of bounds#92
jonandrewdavis wants to merge 1 commit intofoxssake:mainfrom
jonandrewdavis:fix-lobby-select-after-disconnect

Conversation

@jonandrewdavis
Copy link
Contributor

@jonandrewdavis jonandrewdavis commented Jan 21, 2026

Fixes an issue in the browser .gd script:

  • When disconnecting and reconnecting you could select a lobby index higher than the available list
  • When disconnecting and reconnecting, if you had a selection, it was not reset. This sets it to null.

Note: Just setting to null on disconnect should fix everything, but the extra check on if the lobby index is present before selecting could potentially prevent a crash I observed.

To test:

  • 2 clients
  • Connect
  • Create Lobby
  • Select lobby with 1 client
  • Disconnect
  • Reconnect

The selection will cause a crash on main. On this branch, no lobby will be in the selection once re-connected, which would be expected on a fresh session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant