From 3d3065aa629dfdd635b678ac44a72e60ccd3fe06 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 15 Apr 2018 22:19:43 +0200 Subject: [PATCH] Improved force field robustness (code review finding) --- src/main/java/cr0s/warpdrive/data/ForceFieldSetup.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/cr0s/warpdrive/data/ForceFieldSetup.java b/src/main/java/cr0s/warpdrive/data/ForceFieldSetup.java index 5662d322..862e25fc 100644 --- a/src/main/java/cr0s/warpdrive/data/ForceFieldSetup.java +++ b/src/main/java/cr0s/warpdrive/data/ForceFieldSetup.java @@ -145,6 +145,12 @@ public class ForceFieldSetup extends GlobalPosition { Vector3 v3Translation = new Vector3(0.0D, 0.0D, 0.0D); for (final TileEntity tileEntity : tileEntities) { + // sanity check + if (tileEntity == null) { + WarpDrive.logger.error(String.format("Invalid tile entity returned from ForgeFieldRegistry at %s", + this)); + continue; + } // only consider same dimension if (tileEntity.getWorldObj() == null || tileEntity.getWorldObj().provider.dimensionId != dimensionId) { continue;