[Committed] Fix for NullPointerException when texC.coords is null

In some cases (with some importers) the geometry will have a TexCoord object set but the actual buffer (coords) is null, which will result in a NullPointerException in LWJGLRenderer. This patch fixes it:


Index: src/com/jme/renderer/lwjgl/LWJGLRenderer.java
===================================================================
--- src/com/jme/renderer/lwjgl/LWJGLRenderer.java   (revision 5083)
+++ src/com/jme/renderer/lwjgl/LWJGLRenderer.java   (working copy)
@@ -1473,7 +1473,7 @@
                     && i < TextureState.getNumberOfFragmentTexCoordUnits(); i++) {
                 TexCoords texC = g.getTextureCoords(i + offset);
                 oldLimit = -1;
-                if (texC != null) {
+                if (texC != null && texC.coords != null) {
                     // make sure only the necessary texture coords are sent
                     // through on old cards.
                     oldLimit = texC.coords.limit();
@@ -1489,7 +1489,7 @@
                     GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
                     rendRecord.setBoundVBO(vbo.getVBOTextureID(i));
                     GL11.glTexCoordPointer(texC.perVert, GL11.GL_FLOAT, 0, 0);
-                } else if (texC == null) {
+                } else if (texC == null || texC.coords == null) {
                     GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
                 } else if (prevTex[i] != texC.coords) {
                     // textures have changed
@@ -1503,7 +1503,7 @@
                 } else {
                     GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
                 }
-                prevTex[i] = texC != null ? texC.coords : null;
+                prevTex[i] = (texC != null && texC.coords != null) ? texC.coords : null;
                 if (oldLimit != -1)
                     texC.coords.limit(oldLimit);
             }