Applied Energistics 2

Applied Energistics 2

137M Downloads

NullPointerException from ContainerCraftConfirm.getGrid during autocrafting with Induction Smelter

hakanai opened this issue ยท 4 comments

commented

Got the following stack trace:

[20:15:38 ERROR]: Cause of unexpected exception was
java.lang.NullPointerException
at appeng.container.implementations.ContainerCraftConfirm.getGrid(ContainerCraftConfirm.java:296) ~[ContainerCraftConfirm.class:?]
at appeng.container.implementations.ContainerCraftConfirm.func_75142_b(ContainerCraftConfirm.java:139) ~[ContainerCraftConfirm.class:?]
at net.minecraft.entity.player.EntityPlayerMP.func_70071_h_(EntityPlayerMP.java:317) ~[mw.class:?]
at net.minecraft.world.World.func_72866_a(World.java:2740) ~[ahb.class:?]
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:877) ~[mt.class:?]
at net.minecraft.world.World.func_72870_g(World.java:2678) ~[ahb.class:?]
at net.minecraft.world.World.func_72939_s(World.java:2480) ~[ahb.class:?]
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:673) ~[mt.class:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:986) ~[MinecraftServer.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:841) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:693) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

Describe the bug

The crash occurs seemingly at random but probably triggered by autocrafting.

This seems like it occurs if I have a bad recipe in an interface directed at an induction smelter.

In a crack operation, we got into the server and removed the one bad recipe, and the crash hasn't happened since. I believe this confirms that the induction smelter is the culprit - put a bad recipe on it and it throws an exception instead of just doing nothing, perhaps?

Environment

The server is running Infinity Evolved Skyblock. (1.7.10)

commented

Line throwing the exception is here.

commented

Code in the area. Note two possibilities for NPE.

a) this.getTarget() returned null
b) getActionableNode() returned null

Suspecting the latter?

	private IGrid getGrid()
	{
		final IActionHost h = ( (IActionHost) this.getTarget() );
		return h.getActionableNode().getGrid();    // Exception on this line.
	}
commented

We no longer support any minecraft version older than 1.16 at this point.

Should you be able to confirm that this issue still applies to the most recent version, please update the issue and we will reopen it.

commented

In current master, ContainerCraftConfirm seemingly got renamed to CraftConfirmContainer. The code in question is still there:

private IGrid getGrid() {
final IActionHost h = ((IActionHost) this.getTarget());
return h.getActionableNode().getGrid();
}

So there is a question of whether getActionableNode() can return null, so I searched, and found one case where it does:

@Override
public IGridNode getActionableNode() {
this.rangeCheck();
if (this.myWap != null) {
return this.myWap.getActionableNode();
}
return null;
}

So the bug is still there.