Skip to content

Fix NullPointerException in PlayerRadarHud when switching servers by filtering null entities in getPlayers().#6465

Open
Federicorao wants to merge 1 commit into
MeteorDevelopment:masterfrom
Federicorao:codex/issue-6433-1781257331
Open

Fix NullPointerException in PlayerRadarHud when switching servers by filtering null entities in getPlayers().#6465
Federicorao wants to merge 1 commit into
MeteorDevelopment:masterfrom
Federicorao:codex/issue-6433-1781257331

Conversation

@Federicorao

Copy link
Copy Markdown

Fixes #6433.

Fix NullPointerException in PlayerRadarHud when switching servers by filtering null entities in getPlayers(). The crash occurs because mc.level.players() can return null entities during world transitions (e.g., when a StartConfigurationPacket is processed). Adding players.removeIf(entity -> entity == null) right after the addAll prevents the subsequent sort from calling position() on a null entity.

I checked the changed Java file with the available static check.

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.

[Bug] PlayerRadarHud causes crash

1 participant