From 5c8d1a7e3390aaffaf59b31806b1e8a542127028 Mon Sep 17 00:00:00 2001 From: Jason Yeung Date: Wed, 1 Jun 2005 17:49:38 +0000 Subject: [PATCH] drose: fix crash, more work to do --- panda/src/grutil/multitexReducer.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/panda/src/grutil/multitexReducer.cxx b/panda/src/grutil/multitexReducer.cxx index 27366be567..a90772098e 100644 --- a/panda/src/grutil/multitexReducer.cxx +++ b/panda/src/grutil/multitexReducer.cxx @@ -830,15 +830,17 @@ transfer_geom(GeomNode *geom_node, const InternalName *texcoord_name, // to the default name. const qpGeomVertexColumn *column = vdata->get_format()->get_column(texcoord_name); - vdata = vdata->replace_column - (InternalName::get_texcoord(), column->get_num_components(), - column->get_numeric_type(), column->get_contents()); - geom->set_vertex_data(vdata); + if (column != (const qpGeomVertexColumn *)NULL) { + vdata = vdata->replace_column + (InternalName::get_texcoord(), column->get_num_components(), + column->get_numeric_type(), column->get_contents()); + geom->set_vertex_data(vdata); - qpGeomVertexReader from(vdata, texcoord_name); - qpGeomVertexWriter to(vdata, InternalName::get_texcoord()); - while (!from.is_at_end()) { - to.add_data2f(from.get_data2f()); + qpGeomVertexReader from(vdata, texcoord_name); + qpGeomVertexWriter to(vdata, InternalName::get_texcoord()); + while (!from.is_at_end()) { + to.add_data2f(from.get_data2f()); + } } }