Skip to content

Fix NPE in BlockRewriter1_20_2 when block entity has null tag#1262

Merged
kennytv merged 1 commit into
ViaVersion:masterfrom
Zsomi:detached
May 19, 2026
Merged

Fix NPE in BlockRewriter1_20_2 when block entity has null tag#1262
kennytv merged 1 commit into
ViaVersion:masterfrom
Zsomi:detached

Conversation

@Zsomi
Copy link
Copy Markdown
Contributor

@Zsomi Zsomi commented May 19, 2026

The error occurred when you placed a bed using the Minecraft 1.18.2 client on a server that was originally running version 1.20.4.

Copilot AI review requested due to automatic review settings May 19, 2026 06:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a null-pointer exception in the 1.20.2→1.20 block-entity rewrite path when a block entity is received with a null NBT tag (reported when placing a bed with a 1.18.2 client on a server originally running 1.20.4).

Changes:

  • Add an early return in handleBlockEntity when blockEntity.tag() is null to prevent NPEs during tag rewrites.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kennytv kennytv merged commit c3f6271 into ViaVersion:master May 19, 2026
4 of 5 checks passed
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.

3 participants