aaronsun7 / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 1 forks source link

Null Object Reference Error When Loading DAE #204

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

var dae:DAE = new DAE();
dae.load("someDaeFile"); // a dae file which has meshes without vertices

What is the expected output? What do you see instead?

DAE should load without problems, but instead a runtime error occurs:

TypeError: Error #1009: Cannot access a property or method of a null object
reference.

What version of the product are you using? On what operating system?

Tested with trunk Rev 910.
Looking the source, Rev 916 seems to have the same issue.
OS is Windows XP.

Please provide any additional information below.

Error occurs in DAE.buildVertices method. The code should be changed to
return an empty array when mesh.verticies == null.

protected function buildVertices(mesh:DaeMesh):Array {
    if (mesh.vertices == null) return vertices;
    var vertices:Array = new Array();
    ....
}

Maybe meshes without vertices should not exist in a DAE file for the first
place, but this kind of DAE files are sometimes created by my modeling
software (Shade.)

Original issue reported on code.google.com by ichize...@gmail.com on 23 Jun 2009 at 9:35