mkremins / fanciful

Fancy Bukkit message formatting
MIT License
95 stars 82 forks source link

Caused by: java.lang.IllegalArgumentException: The value must be specified. #77

Closed ghost closed 8 years ago

ghost commented 8 years ago

I get this error when using

        FancyMessage message = new FancyMessage()
                                .text(displayKey)
                                    .color(ChatColor.AQUA)
                                .then(link)
                                    .color(ChatColor.BLUE)
                                    .style(ChatColor.ITALIC);
        if (hyperlink) message.link(link);
        if (tooltip != null && tooltip != "") message.tooltip(tooltip).color(ChatColor.AQUA);
        return message.toJSONString();
Stealth2800 commented 8 years ago

Can you post the full stacktrace please?

ghost commented 8 years ago
[20:42:10 WARN]: Unexpected exception while parsing console command "website"
org.bukkit.command.CommandException: Unhandled exception executing command 'website' in plugin Info v1.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[PluginCommand.class:1.7.10-1492.150]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) ~[SimpleCommandMap.class:1.7.10-1492.150]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:717) ~[CraftServer.class:1.7.10-1492.150]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(CraftServer.java:697) [CraftServer.class:1.7.10-1492.150]
        at net.minecraft.server.dedicated.DedicatedServer.func_71333_ah(DedicatedServer.java:473) [lt.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:432) [lt.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:809) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:669) [MinecraftServer.class:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_73]
Caused by: java.lang.IllegalArgumentException: The value must be specified.
        at guava10.com.google.common.base.Preconditions.checkArgument(Preconditions.java:88) ~[Preconditions.class:1.7.10-1492.150]
        at mkremins.fanciful.TextualComponent$ArbitraryTextTypeComponent.setValue(TextualComponent.java:103) ~[?:?]
        at mkremins.fanciful.TextualComponent$ArbitraryTextTypeComponent.<init>(TextualComponent.java:85) ~[?:?]
        at mkremins.fanciful.TextualComponent.rawText(TextualComponent.java:225) ~[?:?]
        at mkremins.fanciful.FancyMessage.then(FancyMessage.java:390) ~[?:?]
        at com.oblivionnetworks.info.Util.formatLink(Util.java:15) ~[?:?]
        at com.oblivionnetworks.info.commands.WebsiteCommand.onCommand(WebsiteCommand.java:19) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[PluginCommand.class:1.7.10-1492.150]
        ... 8 more
ghost commented 8 years ago

It seems to be caused by me using .then(link)

mkremins commented 8 years ago

Is it possible that link is null at this point in your code? The stacktrace indicates that you're passing a null value to .then(), which requires a non-null string.

ghost commented 8 years ago

Ah yes! It is null, I traced it back to incorrect configuration loading, thanks!