Fixed a crash when writing NBT.

This commit is contained in:
AlgorithmX2 2014-07-23 23:20:32 -05:00
parent 2b6cca0267
commit 82d1f8f506

View file

@ -230,12 +230,16 @@ public class PartCable extends AEBasePart implements IPartCable
if ( Platform.isServer() )
{
IGridNode node = getGridNode();
int howMany = 0;
for (IGridConnection gc : getGridNode().getConnections())
howMany = Math.max( gc.getUsedChannels(), howMany );
if ( node != null )
{
for (IGridConnection gc : node.getConnections())
howMany = Math.max( gc.getUsedChannels(), howMany );
data.setByte( "usedChannels", (byte) howMany );
data.setByte( "usedChannels", (byte) howMany );
}
}
}