diff --git a/engine/src/core/com/jme3/scene/VertexBuffer.java b/engine/src/core/com/jme3/scene/VertexBuffer.java index 341edf0b7..7526708d5 100644 --- a/engine/src/core/com/jme3/scene/VertexBuffer.java +++ b/engine/src/core/com/jme3/scene/VertexBuffer.java @@ -423,10 +423,11 @@ public class VertexBuffer extends GLObject implements Savable, Cloneable { } // will force renderer to call glBufferData again - if (this.data.getClass() != data.getClass() || data.limit() != lastLimit){ + if (data != null && (this.data.getClass() != data.getClass() || data.limit() != lastLimit)){ dataSizeChanged = true; lastLimit = data.limit(); } + this.data = data; setUpdateNeeded(); }