From 82d1f8f50609217646cc27847c3f3f4887785cd5 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Wed, 23 Jul 2014 23:20:32 -0500 Subject: [PATCH] Fixed a crash when writing NBT. --- parts/networking/PartCable.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/parts/networking/PartCable.java b/parts/networking/PartCable.java index 9108ed177..264d03976 100644 --- a/parts/networking/PartCable.java +++ b/parts/networking/PartCable.java @@ -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 ); + } } }