]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't crash in bounding sphere generation if an object has a null mesh
authorMikko Rasa <tdb@tdb.fi>
Mon, 20 Oct 2014 08:57:16 +0000 (11:57 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 20 Oct 2014 08:57:16 +0000 (11:57 +0300)
source/object.cpp

index 9aba5466e3e1cf548674b61f2a4b70f156eb8a93..d48b0843fb9f3b73591588631429ce09e2709a8c 100644 (file)
@@ -62,6 +62,9 @@ void Object::update_bounding_sphere()
        vector<Vector3> points;
        for(vector<RefPtr<const Mesh> >::const_iterator i=meshes.begin(); i!=meshes.end(); ++i)
        {
+               if(!*i)
+                       continue;
+
                const VertexArray &vertices = (*i)->get_vertices();
 
                int offset = vertices.get_format().offset(VERTEX3);