Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when deserializing 1.16 window title components via bungeecord-chat #2921

Closed
Exceptionflug opened this issue Jul 21, 2020 · 5 comments

Comments

@Exceptionflug
Copy link

Exceptionflug commented Jul 21, 2020

The current reference implementation of the 1.16 minecraft server produces window title chat components that are declaring a click event without any value property in it. This will cause a NullPointerException since there is so null check to ensure that the specific value key is present in that JSON object. See: https://github.com/SpigotMC/BungeeCord/blob/master/chat/src/main/java/net/md_5/bungee/chat/BaseComponentSerializer.java#L68
The minecraft client is fine with that circumstances. BungeeCord should also be.

Referenced issue where this exception is a problem: Exceptionflug/protocolize#46

@Exceptionflug
Copy link
Author

@md-5 @Janmm14 this needs to be fixed soon.

@Mystiflow
Copy link
Contributor

Possible fix: https://github.com/SpigotMC/BungeeCord/blob/master/chat/src/main/java/net/md_5/bungee/chat/BaseComponentSerializer.java#L68

changed to ( event.has( "value" ) ) ? event.get( "value" ).getAsString() ) : ""; would use an empty string as the fallback instead of null as I assume most plugins wouldn't check that

@Exceptionflug
Copy link
Author

Yes this would fix the NullPointerException.

@Mystiflow
Copy link
Contributor

Mystiflow commented Aug 13, 2020

Just wondering; have you been able to locate where the NMS (or wherever else) is making these window titles without the value?

@Exceptionflug
Copy link
Author

Currently not since I don't have access to nms 1.16 code

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

No branches or pull requests

3 participants