Should fix the NPE in updateTransmitterOnSide.

This commit is contained in:
Ben Spiers 2015-04-12 00:19:49 +01:00
parent 75b41170d3
commit c23aafee9f

View file

@ -35,8 +35,6 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
protected Range4D packetRange = null; protected Range4D packetRange = null;
protected int ticksSinceCreate = 0;
protected int capacity = 0; protected int capacity = 0;
protected double meanCapacity = 0; protected double meanCapacity = 0;
@ -86,11 +84,14 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
for(Entry<IGridTransmitter<A, N>, EnumSet<ForgeDirection>> entry : changedAcceptors.entrySet()) for(Entry<IGridTransmitter<A, N>, EnumSet<ForgeDirection>> entry : changedAcceptors.entrySet())
{ {
IGridTransmitter<A, N> transmitter = entry.getKey(); IGridTransmitter<A, N> transmitter = entry.getKey();
EnumSet<ForgeDirection> directionsChanged = entry.getValue(); if(transmitter.isValid())
for(ForgeDirection side : directionsChanged)
{ {
updateTransmitterOnSide(transmitter, side); EnumSet<ForgeDirection> directionsChanged = entry.getValue();
for(ForgeDirection side : directionsChanged)
{
updateTransmitterOnSide(transmitter, side);
}
} }
} }