Skip to content

Null-check item signs tag in TagCache#6325

Merged
onebeastchris merged 1 commit into
GeyserMC:masterfrom
auvq:fix/tagcache-item-signs-npe
Apr 26, 2026
Merged

Null-check item signs tag in TagCache#6325
onebeastchris merged 1 commit into
GeyserMC:masterfrom
auvq:fix/tagcache-item-signs-npe

Conversation

@auvq

@auvq auvq commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #6261.

TagCache.loadPacket NPEs if the server doesn't send the signs item tag. Added a null check like the block branch right above.

@Novampr Novampr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving on the basis that this works, but to note that later we'll probably use ViaVersion packet payload in order to properly determine the server version and what to emulate.

@onebeastchris

Copy link
Copy Markdown
Member

Have you tested this? This shouldn't ever be null as it's part of standard tags - if it is, I'm curious if the server then follows up by a proper tags packet

@auvq

auvq commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

This one specifically I haven't, the stacktrace showed it was reachable. Agreed signs shouldn't normally be null on vanilla, I assume viaversion-wrapped or modded setups where the first tags packet doesn't include it.

I'm almost certain this fixes it

@onebeastchris

onebeastchris commented Apr 24, 2026

Copy link
Copy Markdown
Member

I agree that it'll fix the NPE, but if it doesn't fix the actual sign detection, that should be accounted for

Signs were, iirc, always sent by Via; did that change?

@auvq

auvq commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Good question on Via - I don't know if something changed there. If Via has been consistently sending signs, then null here isn't the "normal pre-1.13" case I was assuming.

Without a proper alternate signal (the ViaVersion payload work mentioned earlier), I don't have a clean way to detect what emulatePost1_13Logic should actually be when signs is missing. I can either preserve prior state and stop overriding, log a warning and keep current behavior, or close this and defer to the proper version detection work.

My main goal is to stop the crash, but I wouldn't mind working on it further.

Whichever works for you.

@auvq

auvq commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Actually, I looked into it. Via started sending empty tags packets recently (march-ish) as a placeholder during config stage that gets filled in later. That would explain the null case here.

If that's right, probably makes sense to only update emulatePost1_13Logic when signs is actually present, so a later real tags packet handles detection naturally. Or close this and defer, up to you.

@onebeastchris

Copy link
Copy Markdown
Member

Are you able to test whether the signs tag is sent / followed up by via? If that really is followed up, lgtm

@auvq

auvq commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Tested it on vanilla Paper 1.21.11 with the PR applied. Signs tag is sent in the initial UPDATE_TAGS, no NPE, signs work normally on Bedrock. The null branch doesn't fire in the vanilla flow since signs is always present, so for vanilla it's just defensive.

Don't have a Via setup to verify the follow-up behavior I mentioned earlier, so can't confirm that side. But the fix itself is confirmed safe on vanilla at minimum.

@onebeastchris onebeastchris merged commit 11ce458 into GeyserMC:master Apr 26, 2026
2 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.

Exception Occurs when attempting to translate ClientboundUpdateTagsPacket

3 participants