ASE loading problems

Hello world !



I tried to load a very simple cube model from an ASE file (http://kyjylkibo.free.fr/tmp/cube.ASE) and jME throws me some null pointer exceptions.

The Java virtual machine said to me that the bug comes from com.jmex.model.XMLparser.Converters.AseToJme.java line 309 and 345.



Around the line 309 :


...
ASEMaterialInfo mat =
    (ASEMaterialInfo) materials.get(j);
if (mat.file.length() > 0) {
...



Around the line 345 :


...
if (((ASEMaterialInfo) materials.get(j)).file.length()> 0) {
          String filename = ((ASEMaterialInfo) materials.get(j)).file;
...



But in all cases, the  materials.get(j).file was null.

I modified the jME source code and it seems work correctly.

Around the line 309 :


...
ASEMaterialInfo mat =  (ASEMaterialInfo) materials.get(j);
if (mat!=null) {
...



Around the line 345 :


...
ASEMaterialInfo mat = (ASEMaterialInfo) materials.get(j);
if (mat!=null && mat.file!=null && mat.file.length()>0) {
...



Could you say to me if the is the right way to solve my loading problem.


Thank you in Advance.

new code may be helpful

i'm see this kind of problem :slight_smile:

you can temporally rewrite this class and check if material list !=null and size >0