Fixed another NPE when missing serialized waypoints and fixed having different names for write/read

This commit is contained in:
MeFisto94 2016-03-20 20:25:39 +01:00
parent 23fe0658a6
commit 8477fa781b

View File

@ -458,7 +458,7 @@ public class Spline implements Savable {
public void read(JmeImporter im) throws IOException {
InputCapsule in = im.getCapsule(this);
controlPoints = (ArrayList<Vector3f>) in.readSavableArrayList("wayPoints", null);
controlPoints = (ArrayList<Vector3f>) in.readSavableArrayList("controlPoints", new ArrayList<Vector3f>()); /* Empty List as default, prevents null pointers */
float list[] = in.readFloatArray("segmentsLength", null);
if (list != null) {
segmentsLength = new ArrayList<Float>();