From 4e0eab5d75a575a3537140149db962c3dcd78b01 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:02:26 +0000 Subject: [PATCH] Grid movement Fix bug that threw null pointer if grid movement used on a simulated object without a set name. --- src/simulatedAcquisition/movement/GridMovement.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/simulatedAcquisition/movement/GridMovement.java b/src/simulatedAcquisition/movement/GridMovement.java index ca9b576a..2b8e3c2b 100644 --- a/src/simulatedAcquisition/movement/GridMovement.java +++ b/src/simulatedAcquisition/movement/GridMovement.java @@ -131,7 +131,12 @@ public class GridMovement extends MovementModel implements PamSettings { @Override public String getUnitName() { - return getSimObject().name; + if (getSimObject() != null && getSimObject().name != null) { + return getSimObject().name; + } + else { + return "Unknown"; + } } @Override