Add some null checking to the pipe GUIs

Fixes #345
This commit is contained in:
CovertJaguar 2012-10-12 17:36:08 -07:00
parent d351f6455e
commit 1e0e23fe49

View file

@ -25,16 +25,18 @@ public class GuiHandler implements IGuiHandler {
TileGenericPipe pipe = (TileGenericPipe) tile;
switch (ID) {
case GuiIds.PIPE_DIAMOND:
return new ContainerDiamondPipe(player.inventory, (PipeLogicDiamond)pipe.pipe.logic);
case GuiIds.GATES:
return new ContainerGateInterface(player.inventory, pipe.pipe);
default:
if (pipe.pipe == null)
return null;
switch (ID) {
case GuiIds.PIPE_DIAMOND:
return new ContainerDiamondPipe(player.inventory, (PipeLogicDiamond)pipe.pipe.logic);
case GuiIds.GATES:
return new ContainerGateInterface(player.inventory, pipe.pipe);
default:
return null;
}
}
@ -49,16 +51,18 @@ public class GuiHandler implements IGuiHandler {
TileGenericPipe pipe = (TileGenericPipe) tile;
switch (ID) {
case GuiIds.PIPE_DIAMOND:
return new GuiDiamondPipe(player.inventory, pipe);
case GuiIds.GATES:
return new GuiGateInterface(player.inventory, pipe.pipe);
default:
if (pipe.pipe == null)
return null;
switch (ID) {
case GuiIds.PIPE_DIAMOND:
return new GuiDiamondPipe(player.inventory, pipe);
case GuiIds.GATES:
return new GuiGateInterface(player.inventory, pipe.pipe);
default:
return null;
}
}
}