CommandHelper

CommandHelper

46.5k Downloads

json_decode('') returns an error in core.

LadyCailinBot opened this issue ยท 1 comments

commented

CMDHELPER-3044 - Reported by Pieter12345

Problem:
When json_decode() is called with an empty string (doesn't matter if it's a variable or just a string), it will return an error in core.

Error:
[16:20:20] [Server thread/ERROR]: Uh oh! You've found an error in Core.
This is an error caused while running your code, so you may be able to find a workaround, but is ultimately an error in Core itself.
The line of code that caused the error was this:
json_decode('')
on or around Interpreter:1.
Please report this error to the developers, and be sure to include the version numbers:
Server version: 1.8-R0.1-SNAPSHOT;
CommandHelper version: 3.3.1-SNAPSHOT.2837-;
Loaded extensions and versions:
CHDangerous (version 1.0.1);
Core (version 3.3.1);
SKCompat (version 1.0.0);
Here's the stacktrace:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at com.laytonsmith.core.constructs.Construct.json_decode(Construct.java:220)
at com.laytonsmith.core.functions.DataTransformations$json_decode.exec(DataTransformations.java:113)
at com.laytonsmith.core.Script.eval(Script.java:353)
at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1908)
at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1865)
at com.laytonsmith.commandhelper.CommandHelperInterpreterListener.execute(CommandHelperInterpreterListener.java:170)
at com.laytonsmith.commandhelper.CommandHelperInterpreterListener.textLine(CommandHelperInterpreterListener.java:131)
at com.laytonsmith.commandhelper.CommandHelperInterpreterListener$1.run(CommandHelperInterpreterListener.java:70)
at com.laytonsmith.abstraction.bukkit.BukkitConvertor$1.call(BukkitConvertor.java:309)
at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftFuture.run(CraftFuture.java:89)
at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:349)
at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:653)
at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:284)
at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:598)
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:506)
at java.lang.Thread.run(Thread.java:744)

commented

Comment by LadyCailin

Fixed