Carpet

Carpet

2M Downloads

[Scarpet] No stack is being shown in run command, unexpected error occurs

altrisi opened this issue ยท 1 comments

commented

Tested on latest commit (79fb489).

For example, /script run pos() throws NPE:

java.lang.NullPointerException: Cannot read field "host" because "c" is null
	at carpet.script.exception.ExpressionException.makeMessage(ExpressionException.java:75) ~[main/:?]
	at carpet.script.exception.ExpressionException.lambda$1(ExpressionException.java:36) ~[main/:?]
	at carpet.script.exception.ExpressionException.getMessage(ExpressionException.java:90) ~[main/:?]
	at carpet.script.CarpetExpression.scriptRunCommand(CarpetExpression.java:112) ~[main/:?]
	at carpet.commands.ScriptCommand.lambda$74(ScriptCommand.java:495) ~[main/:?]
	at carpet.commands.ScriptCommand.handleCall(ScriptCommand.java:431) ~[main/:?]
	at carpet.commands.ScriptCommand.compute(ScriptCommand.java:493) ~[main/:?]
	at carpet.commands.ScriptCommand.lambda$19(ScriptCommand.java:145) ~[main/:?]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[brigadier-1.0.17.jar:?]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:176) ~[brigadier-1.0.17.jar:?]
	at net.minecraft.server.command.CommandManager.execute(CommandManager.java:249) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.network.ServerPlayNetworkHandler.executeCommand(ServerPlayNetworkHandler.java:1211) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.network.ServerPlayNetworkHandler.method_31286(ServerPlayNetworkHandler.java:1198) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.network.ServerPlayNetworkHandler.onGameMessage(ServerPlayNetworkHandler.java:1177) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket.apply(ChatMessageC2SPacket.java:36) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket.apply(ChatMessageC2SPacket.java:9) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.network.NetworkThreadUtils.method_11072(NetworkThreadUtils.java:21) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.ServerTask.run(ServerTask.java:18) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.util.thread.ThreadExecutor.executeTask(ThreadExecutor.java:144) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.util.thread.ReentrantThreadExecutor.executeTask(ReentrantThreadExecutor.java:23) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:761) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:155) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.util.thread.ThreadExecutor.runTask(ThreadExecutor.java:118) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:743) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.MinecraftServer.runTask(MinecraftServer.java:737) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.util.thread.ThreadExecutor.runTasks(ThreadExecutor.java:127) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:722) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.MinecraftServer.handler$zcg000$modifiedRunLoop(MinecraftServer.java:2819) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:651) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257) ~[minecraft-1.16.5-projectmapped-net.fabricmc.yarn-1.16.5+build.1-v2.jar:?]
	at java.lang.Thread.run(Thread.java:831) [?:?]

commented

smells like compiler optimizations