Grid movement

Fix bug that threw null pointer if grid movement used on a simulated
object without a set name.
This commit is contained in:
Douglas Gillespie 2022-12-12 17:02:26 +00:00
parent d27e4fb19f
commit 4e0eab5d75

View File

@ -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