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 while using command 'class attr' #502

Open
CharlyZhu opened this issue Feb 27, 2020 · 0 comments
Open

NullPointerException while using command 'class attr' #502

CharlyZhu opened this issue Feb 27, 2020 · 0 comments

Comments

@CharlyZhu
Copy link

This error occured when command 'class attr' was being used:
null
org.bukkit.command.CommandException: Unhandled exception executing 'class attr' in class
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:148) ~[spigot.jar:git-Spigot-642f6d2-6103339]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648) ~[spigot.jar:git-Spigot-642f6d2-6103339]
at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1397) ~[spigot.jar:git-Spigot-642f6d2-6103339]
at net.minecraft.server.v1_12_R1.PlayerConnection.chat(PlayerConnection.java:1313) ~[spigot.jar:git-Spigot-642f6d2-6103339]
at org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer.chat(CraftPlayer.java:239) ~[spigot.jar:git-Spigot-642f6d2-6103339]
at me.skymc.taboomenu.iconcommand.impl.IconCommandOp.execute(IconCommandOp.java:23) ~[?:?]
at me.skymc.taboomenu.display.Icon.lambda$null$3(Icon.java:190) ~[?:?]
at java.util.ArrayList.forEach(Unknown Source) ~[?:1.8.0_131]
at me.skymc.taboomenu.display.Icon.lambda$executeCommand$4(Icon.java:190) ~[?:?]
at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:76) [spigot.jar:git-Spigot-642f6d2-6103339]
at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:361) [spigot.jar:git-Spigot-642f6d2-6103339]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:739) [spigot.jar:git-Spigot-642f6d2-6103339]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot.jar:git-Spigot-642f6d2-6103339]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot.jar:git-Spigot-642f6d2-6103339]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot.jar:git-Spigot-642f6d2-6103339]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
Caused by: java.lang.NullPointerException
at com.sucy.skill.api.player.PlayerData.filter(PlayerData.java:530) ~[?:?]
at com.sucy.skill.api.player.PlayerData.openAttributeMenu(PlayerData.java:514) ~[?:?]
at com.sucy.skill.cmd.CmdAttribute.execute(CmdAttribute.java:68) ~[?:?]
at com.rit.sucy.commands.ConfigurableCommand.execute(ConfigurableCommand.java:550) ~[?:?]
at com.rit.sucy.commands.ConfigurableCommand.execute(ConfigurableCommand.java:558) ~[?:?]
at com.rit.sucy.commands.ConfigurableCommand.execute(ConfigurableCommand.java:516) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-642f6d2-6103339]
... 15 more

After debugging with your source code, I think the problem comes from the PlayerData class:
512 ItemStack icon = manager.getAttribute(key).getIcon().clone();
513 ItemMeta meta = icon.getItemMeta();
514 meta.setDisplayName(filter(meta.getDisplayName(), key));
the icon fetched may not have a display name?

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

1 participant