Material#createBlockData throws an internal NullPointerException
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.
Hi @TheLimeGlass, I want to contribute to this issue could you please assign it to me ?
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
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.