Skip to content

Allow parsing with --null #3

@bobhenl

Description

@bobhenl

Hello, there are many errors when players try to parse with -null, I get that it should not be possible, but instead of throwing error returning empty placeholder would be better.

papi parse --null %viaversion_player_protocol_id%

[00:42:12 ERROR]: Command exception: /papi parse --null %viaversion_player_protocol_id%
org.bukkit.command.CommandException: Unhandled exception executing command 'papi' in plugin PlaceholderAPI v2.11.7
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[purpur-api-1.21.10-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.3.10.jar:?]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:5) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:105) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:466) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.commands.Commands.performCommand(Commands.java:372) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.commands.Commands.performCommand(Commands.java:360) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.commands.Commands.performPrefixedCommand(Commands.java:351) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:634) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.server.dedicated.DedicatedServer.tickConnection(DedicatedServer.java:590) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1849) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1645) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.server.dedicated.DedicatedServer.tickServer(DedicatedServer.java:467) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1365) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:388) ~[purpur-1.21.10.jar:1.21.10-2533-802b916]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.NullPointerException

I'm getting other plugin errors due to it too

[00:00:01] [Server thread/INFO]: [ChatControl]  Player: FoundationPlayer{source=TerminalConsoleCommandSender, name=Console}
[00:00:01] [Server thread/INFO]: [ChatControl]  
[00:00:01] [Server thread/INFO]: [ChatControl]  THIS IS IN 99% CASES NOT OUR FAULT. Alert their
[00:00:01] [Server thread/INFO]: [ChatControl]  their developers to fix it first, as in most
[00:00:01] [Server thread/INFO]: [ChatControl]  cases they need to properly account for null
[00:00:01] [Server thread/INFO]: [ChatControl]  player sender or fix their own errors first

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions