Fixed possible crash with network scanning, fixes #1544

This commit is contained in:
raoulvdberge
2017-11-26 11:32:19 +01:00
parent 05a84af1c0
commit c7969c29ca
2 changed files with 7 additions and 3 deletions

View File

@@ -182,10 +182,13 @@ public class NetworkNodeGraph implements INetworkNodeGraph {
for (EnumFacing checkSide : EnumFacing.VALUES) {
if (checkSide != side) { // Avoid going backward
INetworkNodeProxy nodeOnSideProxy = NETWORK_NODE_PROXY_CAPABILITY.cast(tile.getCapability(NETWORK_NODE_PROXY_CAPABILITY, checkSide));
INetworkNode nodeOnSide = nodeOnSideProxy.getNode();
if (nodeOnSide == node) {
operator.apply(world, pos.offset(checkSide), checkSide.getOpposite());
if (nodeOnSideProxy != null) {
INetworkNode nodeOnSide = nodeOnSideProxy.getNode();
if (nodeOnSide == node) {
operator.apply(world, pos.offset(checkSide), checkSide.getOpposite());
}
}
}
}