btk5h / skript-json

JSON support for Skript
MIT License
9 stars 1 forks source link

The JSON form expression throws stacktrace #7

Open Blueyescat opened 6 years ago

Blueyescat commented 6 years ago
[15:41:48] [Server thread/INFO]: executing 'set {x::y} to 10'
[15:41:54] [Server thread/ERROR]: #!#! 
[15:41:54] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[15:41:54] [Server thread/ERROR]: #!#! Unexpected error while executing effect command 'send "%json form of {x::*}%"' by 'CONSOLE'
[15:41:54] [Server thread/ERROR]: #!#! 
[15:41:54] [Server thread/ERROR]: #!#! Something went horribly wrong with Skript.
[15:41:54] [Server thread/ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[15:41:54] [Server thread/ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[15:41:54] [Server thread/ERROR]: #!#! Following plugins are probably related to this error in some way:
[15:41:54] [Server thread/ERROR]: #!#! MundoSK (https://forums.skunity.com/resources/mundosk.69/) 
[15:41:54] [Server thread/ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[15:41:54] [Server thread/ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[15:41:54] [Server thread/ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[15:41:54] [Server thread/ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[15:41:54] [Server thread/ERROR]: #!#! Only if the author tells you to do so, report it as Skript issue (url below)
[15:41:54] [Server thread/ERROR]: #!#! Issue tracker: https://github.com/bensku/Skript/issues (only if you know what you're doing!)
[15:41:54] [Server thread/ERROR]: #!#! 
[15:41:54] [Server thread/ERROR]: #!#! Stack trace:
[15:41:54] [Server thread/ERROR]: #!#! java.lang.NullPointerException
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.VariableString.newInstance(VariableString.java:309)
[15:41:54] [Server thread/ERROR]: #!#!     at
ch.njol.skript.lang.VariableString.newInstance(VariableString.java:145)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:493)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:814)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1535)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1465)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1492)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:225)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:180)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.parse(Effect.java:74)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands.handleEffectCommand(Commands.java:271)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands$1.onServerCommand(Commands.java:180)
[15:41:54] [Server thread/ERROR]: #!#!     at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:35)
[15:41:54] [Server thread/ERROR]: #!#!     at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78)
[15:41:54] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[15:41:54] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:515)
[15:41:54] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:500)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.Skript.dispatchCommand(Skript.java:1185)
[15:41:54] [Server
thread/ERROR]: #!#!     at ch.njol.skript.effects.EffCommand.execute(EffCommand.java:84)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:52)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[15:41:54] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[15:41:54] [Server thread/ERROR]: #!#!     at com.pie.tlatoani.Miscellaneous.Thread.ScopeSync.lambda$go$0(ScopeSync.java:46)
[15:41:54] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:58)
[15:41:54] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:356)
[15:41:54] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:833)
[15:41:54] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:426)
[15:41:54] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:767)
[15:41:54] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:665)
[15:41:54] [Server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:745)
[15:41:54] [Server thread/ERROR]: #!#! 
[15:41:54] [Server thread/ERROR]: #!#! Version Information:
[15:41:54] [Server thread/ERROR]: #!#!   Skript: 2.2-dev35b
[15:41:54] [Server thread/ERROR]: #!#!   Bukkit: 1.12.2-R0.1-SNAPSHOT
[15:41:54] [Server thread/ERROR]: #!#!   Minecraft: 1.12.2
[15:41:54] [Server thread/ERROR]: #!#!   Java: 1.8.0_101 (Java HotSpot(TM) 64-Bit Server VM 25.101-b13)
[15:41:54] [Server thread/ERROR]: #!#!   OS: Linux amd64 4.4.26-nitradoV3-MC-1000-nH-dP-d-i

SkriptJSON 1.1.1 PaperSpigot

Note: don't forget to update the version in plugin.yml.

ilsubyeega commented 5 years ago

Still happens in latest Skript

Blueyescat commented 5 years ago

@btk5h Fix this (return the correct thing) to solve the issue: https://github.com/btk5h/skript-json/blob/master/src/main/java/com/btk5h/skriptjson/skript/ExprJSONToString.java#L169

Happens because of the unnecessary "% %" warning, *`send "%json form of {x::}% "`** works.