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

Material#createBlockData throws an internal NullPointerException #11673

Open
TheLimeGlass opened this issue Nov 26, 2024 · 3 comments
Open

Material#createBlockData throws an internal NullPointerException #11673

TheLimeGlass opened this issue Nov 26, 2024 · 3 comments
Labels
good first issue Simple bug fix or feature which would be a good first PR for someone new to the project priority: low This issue only describes a minor inconvenience. status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added.

Comments

@TheLimeGlass
Copy link

TheLimeGlass commented Nov 26, 2024

Stack trace

[23:14:37 WARN]: java.lang.NullPointerException
[23:14:37 WARN]:        at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1693)
[23:14:37 WARN]:        at org.bukkit.craftbukkit.block.data.CraftBlockData.newData(CraftBlockData.java:568)
[23:14:37 WARN]:        at org.bukkit.craftbukkit.CraftServer.createBlockData(CraftServer.java:2814)
[23:14:37 WARN]:        at org.bukkit.craftbukkit.CraftServer.createBlockData(CraftServer.java:2789)
[23:14:37 WARN]:        at org.bukkit.Bukkit.createBlockData(Bukkit.java:2439)
[23:14:37 WARN]:        at org.bukkit.Material.createBlockData(Material.java:4800)

Plugin and Datapack List

FastAsyncWorldEdit, LuckPerms

Actions to reproduce (if known)

val materials = Material.entries.map { it.createBlockData().asString }

Paper version

1.21.1-52

Other

Spigot or Paper is calling ConcurrentHashMap#get(null)

The method should be throwing IllegalArgumentException and not NullPointerException when the specified data is not valid, as stated by the javadoc.

Placing the map lambda into an ignore try catch solves the issue.

@Lulu13022002 Lulu13022002 added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. priority: low This issue only describes a minor inconvenience. and removed status: needs triage labels Nov 28, 2024
@Karim-Ashraf1
Copy link

Hi @TheLimeGlass, I want to contribute to this issue could you please assign it to me ?

@Strokkur424
Copy link

Hi @TheLimeGlass, I want to contribute to this issue could you please assign it to me ?

You can just open a PR to it, you don't need to have it assigned. You are free to fix this, but if you don't want to anymore, I'd be glad to take over

@Karim-Ashraf1
Copy link

Hi @TheLimeGlass, I want to contribute to this issue could you please assign it to me ?

You can just open a PR to it, you don't need to have it assigned. You are free to fix this, but if you don't want to anymore, I'd be glad to take over

Thanks @Strokkur424, We can tackle it together if that would interest you.

@Machine-Maker Machine-Maker added the good first issue Simple bug fix or feature which would be a good first PR for someone new to the project label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Simple bug fix or feature which would be a good first PR for someone new to the project priority: low This issue only describes a minor inconvenience. status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added.
Projects
Status: No status
Development

No branches or pull requests

5 participants