CommandHelper

CommandHelper

46.5k Downloads

Re-include an empty script

Anatoliy057 opened this issue ยท 0 comments

commented

When re-include an empty script

@path = 'test.ms'
include(@path)
include(@path)

we get:

java.lang.NullPointerException
        at com.laytonsmith.core.compiler.analysis.StaticAnalysis.typecheck(StaticAnalysis.java:352)
        at com.laytonsmith.core.compiler.analysis.StaticAnalysis.typecheck(StaticAnalysis.java:338)
        at com.laytonsmith.core.compiler.analysis.StaticAnalysis.analyzeFinalScopeGraph(StaticAnalysis.java:333)
        at com.laytonsmith.core.functions.DataHandling$include.execs(DataHandling.java:1744)
        at com.laytonsmith.core.functions.DataHandling$include.execs(DataHandling.java:1656)
        at com.laytonsmith.core.Script.eval(Script.java:365)
        at com.laytonsmith.core.Script.eval(Script.java:375)
        at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:2778)
        at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:2736)
        at com.laytonsmith.core.AliasCore$LocalPackage.compileMS(AliasCore.java:746)
        at com.laytonsmith.core.AliasCore.reload(AliasCore.java:384)
        at com.laytonsmith.commandhelper.CommandHelperPlugin.onEnable(CommandHelperPlugin.java:393)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:265)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:347)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:410)
        at org.bukkit.craftbukkit.v1_13_R2.CraftServer.enablePlugin(CraftServer.java:436)
        at org.bukkit.craftbukkit.v1_13_R2.CraftServer.enablePlugins(CraftServer.java:350)
        at net.minecraft.server.v1_13_R2.MinecraftServer.l(MinecraftServer.java:580)
        at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:542)
        at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:420)
        at net.minecraft.server.v1_13_R2.DedicatedServer.init(DedicatedServer.java:294)
        at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:698)
        at java.lang.Thread.run(Unknown Source)

If do not use an intermediate variable path we get:

COMPILE ERROR: An error occurred while analyzing included file
        at :C:\Users\A-y57\Dev\minecraft\plugins\CommandHelper\main.ms:43.2
x2