* Ogre Importer: No longer crashes if submesh name index is out of bounds. Fix issue 548.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10566 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
ShA..Rd 12 years ago
parent ada98f7033
commit a31c8ec884
  1. 7
      engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java

@ -600,7 +600,12 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
private void startSubmeshName(String indexStr, String nameStr) {
int index = Integer.parseInt(indexStr);
geoms.get(index).setName(nameStr);
if (geoms.size() >= index) {
logger.log(Level.WARNING, "Submesh name index is larger than number of geometries: {0} >= {1}",
new Object[]{index, geoms.size()});
} else {
geoms.get(index).setName(nameStr);
}
}
@Override

Loading…
Cancel
Save