Skip to content

Commit

Permalink
fix(client): don't send packets to a server when Minecraft connection…
Browse files Browse the repository at this point in the history
… is null aka in config/login state
  • Loading branch information
Apehum committed Nov 2, 2024
1 parent 17d3bbc commit 672bbc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Versions 2.0.x and 2.1.x are protocol-compatible,
so there’s no need to worry if the server hasn't been updated to 2.1.x.

### Changes in 2.1.2
- Fixed buffer overflow when using AudioSender with delayed first frame.
- Fixed buffer overflow when using AudioSender with delayed first frame.
- Fixed EncoderException on server switch on servers with proxy and proxy-side addons (e.g, groups addon).
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public ModServerConnection(@NotNull BaseVoiceClient voiceClient,

@Override
public void sendPacket(@NotNull Packet<?> packet, boolean checkUdpConnection) {
if (!connection.isConnected()) return;
if (!connection.isConnected() || Minecraft.getInstance().getConnection() == null) return;

if (checkUdpConnection && !voiceClient.getUdpClientManager().isConnected())
return;
Expand Down

0 comments on commit 672bbc3

Please sign in to comment.